├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── drawable
│ │ │ │ ├── send.png
│ │ │ │ ├── settings.png
│ │ │ │ ├── unpair.png
│ │ │ │ ├── ic_search.jpg
│ │ │ │ ├── logo_button.png
│ │ │ │ ├── not_connect.png
│ │ │ │ ├── send_button.png
│ │ │ │ ├── openai_website.png
│ │ │ │ ├── monocle_long_press.png
│ │ │ │ ├── monocle_single_tap.png
│ │ │ │ ├── monocle_translate.png
│ │ │ │ ├── tutorial_image_one.png
│ │ │ │ ├── tutorial_monocle.png
│ │ │ │ ├── tutorial_image_with_cam.png
│ │ │ │ ├── ic_arrow_back_white_24dp.png
│ │ │ │ ├── tutorial_image_single_tap_monocle.png
│ │ │ │ ├── tutorial_mage_single_tap_monocle.png
│ │ │ │ ├── rounded_translated.xml
│ │ │ │ ├── switch_thumb_color_selector.xml
│ │ │ │ ├── rectangle_bg_teal_300_radius_18.xml
│ │ │ │ ├── rounded_rectangle_primary.xml
│ │ │ │ ├── rounded_rectangle_secondary.xml
│ │ │ │ ├── chat_right.xml
│ │ │ │ ├── rounded_shape.xml
│ │ │ │ ├── square_white_background.xml
│ │ │ │ ├── square_gray_background.xml
│ │ │ │ ├── square_gray_background_for_pairing.xml
│ │ │ │ ├── square_white_background_edittext.xml
│ │ │ │ ├── square_white_background_for_paring.xml
│ │ │ │ ├── chat_left.xml
│ │ │ │ ├── ic_arrow_upward.xml
│ │ │ │ ├── ic_home_black_24dp.xml
│ │ │ │ ├── ic_arrow_forward.xml
│ │ │ │ ├── baseline_arrow_back_24.xml
│ │ │ │ ├── baseline_arrow_back_50.xml
│ │ │ │ ├── ic_dashboard_black_24dp.xml
│ │ │ │ ├── download_24.xml
│ │ │ │ ├── round_white_background.xml
│ │ │ │ ├── ic_person.xml
│ │ │ │ ├── ic_mic.xml
│ │ │ │ ├── ic_notifications_black_24dp.xml
│ │ │ │ ├── corner.xml
│ │ │ │ ├── img_vector.xml
│ │ │ │ ├── img_vector_gray_200.xml
│ │ │ │ ├── color_option_1.xml
│ │ │ │ ├── color_option_2.xml
│ │ │ │ ├── rounded_button.xml
│ │ │ │ ├── corner_green.xml
│ │ │ │ ├── chat_bubble_with_tail.xml
│ │ │ │ ├── ic_settings.xml
│ │ │ │ ├── argpt_launcher_background.xml
│ │ │ │ └── ic_launcher_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher_argpt.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ ├── argpt_launcher_icon.png
│ │ │ │ ├── argpt_launcher_icon_round.png
│ │ │ │ ├── argpt_launcher_icon_foreground.png
│ │ │ │ ├── ic_launcher_argpt_adaptive_back.png
│ │ │ │ └── ic_launcher_argpt_adaptive_fore.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher_argpt.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ ├── argpt_launcher_icon.png
│ │ │ │ ├── argpt_launcher_icon_round.png
│ │ │ │ ├── argpt_launcher_icon_foreground.png
│ │ │ │ ├── ic_launcher_argpt_adaptive_back.png
│ │ │ │ └── ic_launcher_argpt_adaptive_fore.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── argpt_launcher_icon.png
│ │ │ │ ├── ic_launcher_argpt.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ ├── argpt_launcher_icon_round.png
│ │ │ │ ├── argpt_launcher_icon_foreground.png
│ │ │ │ ├── ic_launcher_argpt_adaptive_back.png
│ │ │ │ └── ic_launcher_argpt_adaptive_fore.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher_argpt.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ ├── argpt_launcher_icon.png
│ │ │ │ ├── argpt_launcher_icon_round.png
│ │ │ │ ├── argpt_launcher_icon_foreground.png
│ │ │ │ ├── ic_launcher_argpt_adaptive_back.png
│ │ │ │ └── ic_launcher_argpt_adaptive_fore.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher_argpt.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ ├── argpt_launcher_icon.png
│ │ │ │ ├── argpt_launcher_icon_round.png
│ │ │ │ ├── argpt_launcher_icon_foreground.png
│ │ │ │ ├── ic_launcher_argpt_adaptive_back.png
│ │ │ │ └── ic_launcher_argpt_adaptive_fore.png
│ │ │ ├── values
│ │ │ │ ├── argpt_launcher_icon_background.xml
│ │ │ │ ├── attrs.xml
│ │ │ │ ├── styles.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── themes.xml
│ │ │ │ └── strings.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher_argpt.xml
│ │ │ │ ├── argpt_launcher_icon.xml
│ │ │ │ └── argpt_launcher_icon_round.xml
│ │ │ ├── layout
│ │ │ │ ├── popup.xml
│ │ │ │ ├── activity_base.xml
│ │ │ │ ├── list_item_device_list.xml
│ │ │ │ ├── full_screen_popup.xml
│ │ │ │ ├── chat_item_cell_left.xml
│ │ │ │ ├── custom_progress_dialog.xml
│ │ │ │ ├── chat_item_cell_right.xml
│ │ │ │ ├── chat_item_cell_center.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ ├── chat_item_cell_right_with_corner.xml
│ │ │ │ ├── chat_item_cell_left_with_corner.xml
│ │ │ │ ├── activity_api_screen.xml
│ │ │ │ ├── popup_layout.xml
│ │ │ │ ├── activity_chat_gpt.xml
│ │ │ │ ├── api_key_change_popup.xml
│ │ │ │ ├── stability_api_key_change.xml
│ │ │ │ ├── activity_pairing_screen.xml
│ │ │ │ └── api_key_change_popup_open_ai_stability_api.xml
│ │ │ ├── xml
│ │ │ │ ├── backup_rules.xml
│ │ │ │ └── data_extraction_rules.xml
│ │ │ ├── menu
│ │ │ │ └── bottom_nav_menu.xml
│ │ │ ├── values-night
│ │ │ │ ├── colors.xml
│ │ │ │ ├── themes.xml
│ │ │ │ └── strings.xml
│ │ │ └── drawable-v24
│ │ │ │ └── ic_launcher_foreground.xml
│ │ ├── ic_launcher-playstore.png
│ │ ├── argpt_launcher-playstore.png
│ │ ├── argpt_launcher_icon-playstore.png
│ │ ├── assets
│ │ │ ├── FPGA
│ │ │ │ └── monocle-fpga-v23.230.0808.bin
│ │ │ ├── Firmware
│ │ │ │ └── monocle-micropython-v23.248.0754.zip
│ │ │ └── Scripts
│ │ │ │ ├── photo.py
│ │ │ │ ├── audio.py
│ │ │ │ ├── states.py
│ │ │ │ ├── graphics.py
│ │ │ │ └── main.py
│ │ ├── java
│ │ │ └── xyz
│ │ │ │ └── brilliant
│ │ │ │ └── argpt
│ │ │ │ ├── ui
│ │ │ │ ├── model
│ │ │ │ │ └── ChatModel.kt
│ │ │ │ ├── fragment
│ │ │ │ │ ├── ScanningFragment.kt
│ │ │ │ │ └── FullScreenPopup.kt
│ │ │ │ └── adapter
│ │ │ │ │ ├── DevicesAdapter.java
│ │ │ │ │ └── ChatAdapter.kt
│ │ │ │ └── service
│ │ │ │ ├── BluetoothBackgroundService.kt
│ │ │ │ └── ForegroundService.kt
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── xyz
│ │ │ └── brilliant
│ │ │ └── argpt
│ │ │ └── ExampleUnitTest.kt
│ └── androidTest
│ │ └── java
│ │ └── xyz
│ │ └── brilliant
│ │ └── argpt
│ │ └── ExampleInstrumentedTest.kt
├── release
│ └── output-metadata.json
├── proguard-rules.pro
└── build.gradle
├── README.md
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .gitignore
├── settings.gradle
├── gradle.properties
├── gradlew.bat
└── gradlew
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # gpt-connect-for-android
2 |
3 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/res/drawable/send.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/drawable/send.png
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-playstore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/ic_launcher-playstore.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/drawable/settings.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/unpair.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/drawable/unpair.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_search.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/drawable/ic_search.jpg
--------------------------------------------------------------------------------
/app/src/main/argpt_launcher-playstore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/argpt_launcher-playstore.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/logo_button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/drawable/logo_button.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/not_connect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/drawable/not_connect.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/send_button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/drawable/send_button.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/openai_website.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/drawable/openai_website.png
--------------------------------------------------------------------------------
/app/src/main/argpt_launcher_icon-playstore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/argpt_launcher_icon-playstore.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/monocle_long_press.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/drawable/monocle_long_press.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/monocle_single_tap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/drawable/monocle_single_tap.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/monocle_translate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/drawable/monocle_translate.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/tutorial_image_one.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/drawable/tutorial_image_one.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/tutorial_monocle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/drawable/tutorial_monocle.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_argpt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-hdpi/ic_launcher_argpt.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_argpt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-mdpi/ic_launcher_argpt.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/tutorial_image_with_cam.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/drawable/tutorial_image_with_cam.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/argpt_launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-hdpi/argpt_launcher_icon.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/argpt_launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-mdpi/argpt_launcher_icon.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/argpt_launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-xhdpi/argpt_launcher_icon.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_argpt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-xhdpi/ic_launcher_argpt.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_argpt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-xxhdpi/ic_launcher_argpt.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_argpt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-xxxhdpi/ic_launcher_argpt.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/assets/FPGA/monocle-fpga-v23.230.0808.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/assets/FPGA/monocle-fpga-v23.230.0808.bin
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_arrow_back_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/drawable/ic_arrow_back_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/argpt_launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-xxhdpi/argpt_launcher_icon.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/argpt_launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-xxxhdpi/argpt_launcher_icon.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/argpt_launcher_icon_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-hdpi/argpt_launcher_icon_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/argpt_launcher_icon_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-mdpi/argpt_launcher_icon_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/argpt_launcher_icon_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-xhdpi/argpt_launcher_icon_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/argpt_launcher_icon_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-xxhdpi/argpt_launcher_icon_round.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/tutorial_image_single_tap_monocle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/drawable/tutorial_image_single_tap_monocle.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/tutorial_mage_single_tap_monocle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/drawable/tutorial_mage_single_tap_monocle.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/argpt_launcher_icon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-hdpi/argpt_launcher_icon_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/argpt_launcher_icon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-mdpi/argpt_launcher_icon_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/argpt_launcher_icon_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-xxxhdpi/argpt_launcher_icon_round.png
--------------------------------------------------------------------------------
/app/src/main/assets/Firmware/monocle-micropython-v23.248.0754.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/assets/Firmware/monocle-micropython-v23.248.0754.zip
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_argpt_adaptive_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-hdpi/ic_launcher_argpt_adaptive_back.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_argpt_adaptive_fore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-hdpi/ic_launcher_argpt_adaptive_fore.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_argpt_adaptive_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-mdpi/ic_launcher_argpt_adaptive_back.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_argpt_adaptive_fore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-mdpi/ic_launcher_argpt_adaptive_fore.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/argpt_launcher_icon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-xhdpi/argpt_launcher_icon_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_argpt_adaptive_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-xhdpi/ic_launcher_argpt_adaptive_back.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_argpt_adaptive_fore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-xhdpi/ic_launcher_argpt_adaptive_fore.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/argpt_launcher_icon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-xxhdpi/argpt_launcher_icon_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/values/argpt_launcher_icon_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #262626
4 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_argpt_adaptive_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-xxhdpi/ic_launcher_argpt_adaptive_back.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_argpt_adaptive_fore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-xxhdpi/ic_launcher_argpt_adaptive_fore.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/argpt_launcher_icon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-xxxhdpi/argpt_launcher_icon_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_argpt_adaptive_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-xxxhdpi/ic_launcher_argpt_adaptive_back.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_argpt_adaptive_fore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brilliantlabsAR/noa-for-android/main/app/src/main/res/mipmap-xxxhdpi/ic_launcher_argpt_adaptive_fore.png
--------------------------------------------------------------------------------
/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/rounded_translated.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/switch_thumb_color_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Aug 03 10:13:05 IST 2023
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
5 | zipStoreBase=GRADLE_USER_HOME
6 | zipStorePath=wrapper/dists
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/rectangle_bg_teal_300_radius_18.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/rounded_rectangle_primary.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/rounded_rectangle_secondary.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/chat_right.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/rounded_shape.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_argpt.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/argpt_launcher_icon.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/square_white_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/argpt_launcher_icon_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/square_gray_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/square_gray_background_for_pairing.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/square_white_background_edittext.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/square_white_background_for_paring.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/chat_left.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_arrow_upward.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_home_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | gradlePluginPortal()
6 | }
7 | }
8 | dependencyResolutionManagement {
9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
10 | repositories {
11 | google()
12 | mavenCentral()
13 | }
14 | }
15 | rootProject.name = "argpt"
16 | include ':app'
17 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_arrow_forward.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/baseline_arrow_back_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/baseline_arrow_back_50.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_dashboard_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/download_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/round_white_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_person.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/popup.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/java/xyz/brilliant/argpt/ui/model/ChatModel.kt:
--------------------------------------------------------------------------------
1 | package xyz.brilliant.argpt.ui.model
2 |
3 | import android.graphics.Bitmap
4 |
5 | data class ChatModel(
6 | val id: Int,// 1= normal message , 2= Open Api Key pop up msg , 3 = Stability Api Key pop up msg, 4 = url link
7 | val userInfo: String,
8 | val message: String,
9 | val translateEnabled : Boolean = false,
10 | val image : String = "",
11 | val bitmap: Bitmap?=null
12 | )
--------------------------------------------------------------------------------
/app/src/test/java/xyz/brilliant/argpt/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package xyz.brilliant.argpt
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
--------------------------------------------------------------------------------
/app/release/output-metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 3,
3 | "artifactType": {
4 | "type": "APK",
5 | "kind": "Directory"
6 | },
7 | "applicationId": "xyz.brilliant.argpt",
8 | "variantName": "release",
9 | "elements": [
10 | {
11 | "type": "SINGLE",
12 | "filters": [],
13 | "attributes": [],
14 | "versionCode": 10,
15 | "versionName": "1.1.008",
16 | "outputFile": "app-release.apk"
17 | }
18 | ],
19 | "elementType": "File"
20 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_mic.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_notifications_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/backup_rules.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/corner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/img_vector.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/img_vector_gray_200.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/color_option_1.xml:
--------------------------------------------------------------------------------
1 |
2 | -
3 |
4 |
5 |
6 |
7 |
10 |
11 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/color_option_2.xml:
--------------------------------------------------------------------------------
1 |
2 | -
3 |
4 |
5 |
6 |
7 |
10 |
11 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/rounded_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
11 |
12 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/data_extraction_rules.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
12 |
13 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/bottom_nav_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/corner_green.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | -
7 |
9 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_base.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/xyz/brilliant/argpt/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package xyz.brilliant.argpt
2 |
3 | import androidx.test.platform.app.InstrumentationRegistry
4 | import androidx.test.ext.junit.runners.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22 | assertEquals("xyz.brilliant.argpt", appContext.packageName)
23 | }
24 | }
--------------------------------------------------------------------------------
/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/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
11 |
12 |
17 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/chat_bubble_with_tail.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
9 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | -
22 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_settings.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/assets/Scripts/photo.py:
--------------------------------------------------------------------------------
1 | import bluetooth
2 | import camera
3 | import states
4 |
5 | def capture_image(state, gfx, send_message):
6 | if state.on_entry():
7 | camera.capture()
8 | send_message(b"ist:")
9 | gfx.clear_response()
10 | gfx.set_prompt("Sending photo [ ]")
11 | state.after(250, state.SendImage)
12 |
13 | def send_image(state, gfx, send_message):
14 | if state.on_entry():
15 | state.current_state.bytes_sent = 0
16 | samples = bluetooth.max_length() - 4
17 | chunk = camera.read(samples)
18 | if chunk == None:
19 | # Finished, start microphone recording next. The microphone recording state will
20 | # send the "ien:" command!
21 | state.after(0, state.StartRecording)
22 | else:
23 | send_message(b"idt:" + chunk)
24 | state.current_state.bytes_sent += len(chunk)
25 | benchmark_size = 64000
26 | percent = state.current_state.bytes_sent / benchmark_size
27 | if percent > 0.8:
28 | gfx.set_prompt("Sending photo [=====]")
29 | elif percent > 0.6:
30 | gfx.set_prompt("Sending photo [==== ]")
31 | elif percent > 0.4:
32 | gfx.set_prompt("Sending photo [=== ]")
33 | elif percent > 0.2:
34 | gfx.set_prompt("Sending photo [== ]")
35 | else:
36 | gfx.set_prompt("Sending photo [= ]")
37 |
--------------------------------------------------------------------------------
/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. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec: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 | # Kotlin code style for this project: "official" or "obsolete":
19 | kotlin.code.style=official
20 | # Enables namespacing of each library's R class so that its R class includes only the
21 | # resources declared in the library itself and none from the library's dependencies,
22 | # thereby reducing the size of the R class for that library
23 | android.nonTransitiveRClass=true
--------------------------------------------------------------------------------
/app/src/main/assets/Scripts/audio.py:
--------------------------------------------------------------------------------
1 | import bluetooth
2 | import microphone
3 | import states
4 |
5 | def start_recording(state, gfx, send_message):
6 | if state.on_entry():
7 | microphone.record(seconds=6.0, bit_depth=8, sample_rate=8000)
8 | if state.previous_state == state.SendImage:
9 | send_message(b"ien:") # continue image-and-prompt flow
10 | else:
11 | send_message(b"ast:") # *prompt only* (erases image data)
12 | gfx.clear_response()
13 | gfx.set_prompt("Listening [ ]")
14 | state.after(1000, state.SendAudio)
15 |
16 | def send_audio(state, gfx, send_message):
17 | if state.has_been() > 5000:
18 | gfx.set_prompt("Waiting for openAI")
19 | elif state.has_been() > 4000:
20 | gfx.set_prompt("Listening [=====]")
21 | elif state.has_been() > 3000:
22 | gfx.set_prompt("Listening [==== ]")
23 | elif state.has_been() > 2000:
24 | gfx.set_prompt("Listening [=== ]")
25 | elif state.has_been() > 1000:
26 | gfx.set_prompt("Listening [== ]")
27 | else:
28 | gfx.set_prompt("Listening [= ]")
29 |
30 | samples = (bluetooth.max_length() - 4) // 2
31 | chunk1 = microphone.read(samples)
32 | chunk2 = microphone.read(samples)
33 |
34 | if chunk1 == None:
35 | send_message(b"aen:")
36 | state.after(0, state.WaitForPing)
37 | elif chunk2 == None:
38 | send_message(b"dat:" + chunk1)
39 | else:
40 | send_message(b"dat:" + chunk1 + chunk2)
41 |
--------------------------------------------------------------------------------
/app/src/main/res/values-night/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #0C0C0C
10 | #FFFFFFFF
11 | #3F51B5
12 | #303F9F
13 | #FF4081
14 | #FF039BE5
15 | #FF01579B
16 | #FF40C4FF
17 | #FF00B0FF
18 | #66000000
19 | #F5F5F5
20 | #BDBDBD
21 | #FF0000
22 | #57c7a9
23 | #F9F9F9
24 | #57C7AA
25 | #E9E9EB
26 | #575BC7
27 |
28 | #57C7AA
29 | #787880
30 |
31 | #F3F2F2
32 | #1B1C1E
33 | #000000
34 | #5E5E5E
35 | #0C0C0C
36 | #1D1D1F
37 |
38 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #0C0C0C
10 | #FFFFFFFF
11 | #3F51B5
12 | #303F9F
13 | #FF4081
14 | #FF039BE5
15 | #FF01579B
16 | #FF40C4FF
17 | #FF00B0FF
18 | #66000000
19 | #F5F5F5
20 | #BDBDBD
21 | #FF0000
22 | #57c7a9
23 | #F9F9F9
24 | #57C7AA
25 | #E9E9EB
26 | #575BC7
27 |
28 | #57C7AA
29 | #787880
30 |
31 | #000000
32 | #E9E9EB
33 | #FFFFFF
34 | #BDBDBD
35 | @android:color/transparent
36 | #F5F5F5
37 |
38 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/src/main/assets/Scripts/states.py:
--------------------------------------------------------------------------------
1 | import time
2 |
3 |
4 | class State:
5 | class Init:
6 | pass
7 |
8 | class Welcome:
9 | pass
10 |
11 | class Connected:
12 | pass
13 |
14 | class WaitForTap:
15 | pass
16 |
17 | class DetectSingleTap:
18 | pass
19 |
20 | class DetectHold:
21 | pass
22 |
23 | class StartRecording:
24 | pass
25 |
26 | class SendAudio:
27 | pass
28 |
29 | class WaitForPing:
30 | pass
31 |
32 | class WaitForResponse:
33 | pass
34 |
35 | class AskToCancel:
36 | pass
37 |
38 | class PrintResponse:
39 | pass
40 |
41 | class CaptureImage:
42 | pass
43 |
44 | class SendImage:
45 | pass
46 |
47 | class Undefined:
48 | pass
49 |
50 | def __init__(self):
51 | self.previous_state = self.Init
52 | self.current_state = self.Init
53 | self.__next_state = self.Init
54 | self.__entry_time = time.ticks_ms()
55 | self.__entered = True
56 |
57 | def after(self, wait_time, next_state):
58 | if next_state != self.__next_state:
59 | self.__next_state = next_state
60 |
61 | if self.current_state != self.__next_state:
62 | if time.ticks_diff(time.ticks_ms(), self.__entry_time) > wait_time:
63 | self.previous_state = self.current_state
64 | self.current_state = self.__next_state
65 | self.__entry_time = time.ticks_ms()
66 | self.__entered = True
67 | print("State: ", str(self.current_state.__name__))
68 |
69 | def has_been(self):
70 | return time.ticks_diff(time.ticks_ms(), self.__entry_time)
71 |
72 | def on_entry(self):
73 | if self.__entered == True:
74 | self.__entered = False
75 | return True
76 | return False
77 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_item_device_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
19 |
27 |
28 |
29 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/full_screen_popup.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
13 |
14 |
18 |
19 |
26 |
27 |
28 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
48 |
49 |
--------------------------------------------------------------------------------
/app/src/main/java/xyz/brilliant/argpt/service/BluetoothBackgroundService.kt:
--------------------------------------------------------------------------------
1 | package xyz.brilliant.argpt.service
2 |
3 | import android.R
4 | import android.app.Notification
5 | import android.app.NotificationChannel
6 | import android.app.NotificationManager
7 | import android.app.Service
8 | import android.content.Intent
9 | import android.os.Build
10 | import android.os.Handler
11 | import android.os.IBinder
12 | import android.util.Log
13 |
14 |
15 | class BluetoothBackgroundService : Service() {
16 | /* private lateinit var handler: Handler
17 | private lateinit var runnable: Runnable*/
18 | override fun onBind(intent: Intent): IBinder? {
19 | // Return null since this is not a bound service
20 | return null
21 | }
22 |
23 | override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
24 | Thread {
25 | while (true) {
26 | Log.e("Service", "Service is running...")
27 | try {
28 | Thread.sleep(2000)
29 | } catch (e: InterruptedException) {
30 | e.printStackTrace()
31 | }
32 | }
33 | }.start()
34 | val CHANNELID = "Foreground Service ID"
35 | val channel = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
36 | NotificationChannel(
37 | CHANNELID,
38 | CHANNELID,
39 | NotificationManager.IMPORTANCE_LOW
40 | )
41 | } else {
42 | TODO("VERSION.SDK_INT < O")
43 | }
44 |
45 | getSystemService(NotificationManager::class.java).createNotificationChannel(channel)
46 | val notification: Notification.Builder = Notification.Builder(this, CHANNELID)
47 | .setContentText("Service is running")
48 | .setContentTitle("Service enabled")
49 | .setSmallIcon(R.drawable.sym_def_app_icon)
50 |
51 | startForeground(1001, notification.build())
52 | return super.onStartCommand(intent, flags, startId)
53 | }
54 |
55 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/chat_item_cell_left.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
37 |
38 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/custom_progress_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
26 |
34 |
35 |
44 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/chat_item_cell_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
17 |
18 |
26 |
36 |
37 |
53 |
54 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | id 'org.jetbrains.kotlin.android'
4 | }
5 | android {
6 | namespace 'xyz.brilliant.argpt'
7 | compileSdk 33
8 |
9 | defaultConfig {
10 | applicationId 'xyz.brilliant.argpt'
11 | minSdk 24
12 | targetSdk 33
13 | versionCode 12
14 | versionName "1.1.010"
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 | }
24 | }
25 | compileOptions {
26 | sourceCompatibility JavaVersion.VERSION_1_8
27 | targetCompatibility JavaVersion.VERSION_1_8
28 | }
29 | kotlinOptions {
30 | jvmTarget = '1.8'
31 | }
32 | buildFeatures {
33 | viewBinding true
34 | }
35 | }
36 |
37 |
38 | dependencies {
39 |
40 | implementation 'androidx.core:core-ktx:1.8.0'
41 | implementation platform('org.jetbrains.kotlin:kotlin-bom:1.8.0')
42 | implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
43 | implementation 'androidx.activity:activity-compose:1.5.1'
44 | implementation platform('androidx.compose:compose-bom:2022.10.00')
45 | implementation 'androidx.compose.ui:ui'
46 | implementation 'androidx.compose.ui:ui-graphics'
47 | implementation 'androidx.compose.ui:ui-tooling-preview'
48 | implementation 'androidx.compose.material3:material3'
49 | implementation 'no.nordicsemi.android:ble:2.6.1'
50 | implementation'com.squareup.okhttp3:okhttp:4.10.0'
51 | implementation 'androidx.appcompat:appcompat:1.0.0'
52 | implementation 'com.google.android.material:material:1.9.0'
53 | implementation 'androidx.recyclerview:recyclerview:1.2.1'
54 | testImplementation 'junit:junit:4.13.2'
55 | androidTestImplementation 'androidx.test.ext:junit:1.1.5'
56 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
57 | androidTestImplementation platform('androidx.compose:compose-bom:2022.10.00')
58 | androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
59 | debugImplementation 'androidx.compose.ui:ui-tooling'
60 | debugImplementation 'androidx.compose.ui:ui-test-manifest'
61 | implementation 'com.github.bumptech.glide:glide:4.12.0'
62 | implementation 'org.jsoup:jsoup:1.14.3'
63 | annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
64 |
65 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/chat_item_cell_center.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
16 |
17 |
25 |
39 |
40 |
59 |
60 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
14 |
15 |
22 |
32 |
33 |
34 |
46 |
47 |
59 |
60 |
61 |
62 |
75 |
--------------------------------------------------------------------------------
/app/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
23 |
24 |
28 |
29 |
37 |
45 |
46 |
49 |
50 |
53 |
54 |
--------------------------------------------------------------------------------
/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
19 |
20 |
28 |
29 |
30 |
41 |
42 |
47 |
48 |
52 |
53 |
56 |
57 |
58 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/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/res/layout/chat_item_cell_right_with_corner.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
16 |
17 |
22 |
31 |
32 |
41 |
42 |
43 |
59 |
60 |
61 |
62 |
63 |
64 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
27 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
58 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/chat_item_cell_left_with_corner.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
39 |
44 |
45 |
54 |
55 |
71 |
72 |
79 |
80 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_api_screen.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
26 |
38 |
53 |
54 |
55 |
65 |
66 |
67 |
80 |
81 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/app/src/main/assets/Scripts/graphics.py:
--------------------------------------------------------------------------------
1 | import display
2 | import time
3 | import re
4 |
5 |
6 | class Graphics:
7 | def __init__(self):
8 | self.MAX_LINES = 7
9 | self.WORD_SPEED = 300
10 | self.FRAME_RATE = 15
11 | self.error_flag = False
12 | self.done_printing = False
13 | self.__current_response = ""
14 | self.__current_response_word = 0
15 | self.__current_response_line_offset = 0
16 | self.__current_prompt = ""
17 | self.__last_frame_time = time.ticks_ms()
18 | self.__last_word_time = time.ticks_ms()
19 |
20 | def clear_response(self):
21 | self.__current_response = ""
22 | self.__current_response_word = 0
23 | self.__current_response_line_offset = 0
24 | self.done_printing = False
25 |
26 | def append_response(self, response):
27 | self.__current_response += re.sub("""\n+""", " ", response)
28 |
29 | def set_prompt(self, prompt):
30 | if self.__current_prompt != prompt:
31 | self.__current_prompt = prompt
32 |
33 | def __split_lines(self, words):
34 | word_arrays = []
35 | current_array = []
36 | current_length = 0
37 | max_characters = display.WIDTH // display.FONT_WIDTH
38 |
39 | for word in words:
40 | word_length = len(word)
41 | if word == "":
42 | word_arrays.append(current_array)
43 | current_array = []
44 | current_length = max_characters
45 | elif current_length + word_length + len(current_array) <= max_characters:
46 | current_array.append(word)
47 | current_length += word_length
48 | else:
49 | word_arrays.append(current_array)
50 | current_array = [word]
51 | current_length = word_length
52 |
53 | if current_array:
54 | word_arrays.append(current_array)
55 |
56 | return word_arrays
57 |
58 | def run(self):
59 | if time.ticks_ms() - self.__last_frame_time > self.FRAME_RATE:
60 | self.__last_frame_time = time.ticks_ms()
61 | response_words = self.__current_response.split(" ")
62 |
63 | # Spacial case to zero out empty buffer
64 | if response_words == [""]:
65 | response_words = []
66 |
67 | partial_response_words = response_words[: self.__current_response_word]
68 | response_lines = self.__split_lines(partial_response_words)
69 |
70 | if len(response_lines) > self.MAX_LINES:
71 | self.__current_response_line_offset = (
72 | len(response_lines) - self.MAX_LINES
73 | )
74 |
75 | text_objects = []
76 | response_color = display.RED if self.error_flag else display.WHITE
77 |
78 | for line in range(self.MAX_LINES):
79 | if len(response_lines) > line:
80 | text = " ".join(
81 | response_lines[self.__current_response_line_offset + line]
82 | )
83 | text_objects.append(
84 | display.Text(text, 0, 50 * line, response_color)
85 | )
86 |
87 | if response_words == partial_response_words:
88 | text_objects.append(
89 | display.Text(
90 | self.__current_prompt,
91 | 320,
92 | 400,
93 | display.YELLOW,
94 | justify=display.BOTTOM_CENTER,
95 | )
96 | )
97 |
98 | display.show(text_objects)
99 |
100 | if time.ticks_ms() - self.__last_word_time > self.WORD_SPEED:
101 | self.__last_word_time = time.ticks_ms()
102 | if self.__current_response_word == len(response_words):
103 | if len(response_words) > 0:
104 | self.done_printing = True
105 | return
106 | self.__current_response_word += 1
107 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Noa
3 | Home
4 | Dashboard
5 | Notifications
6 |
7 | Choose the device role:
8 | Peripheral/Server
9 | Central/Client
10 | scan
11 | Advertise Device
12 | Notify Client
13 | Peripheral/Server screen
14 | Central/Client screen
15 | Bluetooth is not supported on this device.
16 | Bluetooth Advertisements are not supported on this device.
17 | User declined to enable Bluetooth.
18 | User declined to permit ACCESS_COARSE_LOCATION.
19 | Scanning already started.
20 | Scanning for
21 | seconds.
22 | No devices found - refresh to try again.
23 | Advertising stopped due to timeout.
24 | Unknown error.
25 | connect
26 | Connected
27 | Disconnected
28 | Central Connection screen
29 | Connection Status
30 | Connected Device Name
31 | Server Characteristic value
32 | An error occurred when connecting to a device. Error Code
33 | Choose color
34 | Request Characteristic
35 | Characteristic value received: %1$d
36 | SearchActivity
37 | Dummy Button
38 | DUMMY\nCONTENT
39 | > Brilliant (Labs)
40 | Noa
41 | Let\'s pair your device. Take your Monocle out of the case, and bring it close.
42 | Bring your device close.
43 | Searching
44 | Next, enter your OpenAI developer API key. If you don\'t have one. You can sign up here
45 | Enter your api key
46 | Ask a question
47 | Be sure to read our Privacy Policy, as well as\n Terms and Conditions before using arGPT
48 | Be sure to read our Privacy Policy]]>, as well as Terms and Conditions]]> before using arGPT
49 |
50 | Be sure to read our Privacy Policy, as well as\n Terms and Conditions before using arGPT
51 |
52 | Hello blank fragment
53 |
54 |
--------------------------------------------------------------------------------
/app/src/main/java/xyz/brilliant/argpt/service/ForegroundService.kt:
--------------------------------------------------------------------------------
1 | package xyz.brilliant.argpt.service
2 |
3 | import android.app.Application
4 | import android.app.Notification
5 | import android.app.NotificationChannel
6 | import android.app.NotificationManager
7 | import android.app.PendingIntent
8 | import android.app.Service
9 | import android.content.BroadcastReceiver
10 | import android.content.Context
11 | import android.content.Intent
12 | import android.content.IntentFilter
13 | import android.os.Build
14 | import android.os.IBinder
15 | import androidx.core.app.NotificationCompat
16 | import xyz.brilliant.argpt.R
17 |
18 |
19 | class ForegroundService : Service() {
20 |
21 | private val CHANNEL_ID = "ForegroundServiceChannel"
22 | private val NOTIFICATION_ID = 1
23 |
24 | override fun onCreate() {
25 | super.onCreate()
26 | createNotificationChannel()
27 | val notification: Notification = createNotification(true)
28 | startForeground(NOTIFICATION_ID, notification)
29 | }
30 |
31 | override fun onDestroy() {
32 | unregisterReceiver(connectionStatusReceiver);
33 | super.onDestroy()
34 | }
35 | private fun triggerScan() {
36 | val intent = Intent("ACTION_START_SCAN")
37 | sendBroadcast(intent)
38 | }
39 | override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
40 | val filter = IntentFilter("ACTION_CONNECTION_STATUS")
41 | registerReceiver(connectionStatusReceiver, filter)
42 | Thread {
43 | while (true) {
44 | triggerScan()
45 | try {
46 | Thread.sleep(5000)
47 | } catch (e: InterruptedException) {
48 | e.printStackTrace()
49 | }
50 | }
51 | }.start()
52 | return super.onStartCommand(intent, flags, startId)
53 | }
54 | private val connectionStatusReceiver: BroadcastReceiver = object : BroadcastReceiver() {
55 | override fun onReceive(context: Context, intent: Intent) {
56 | println("working")
57 | if (intent?.action == "ACTION_CONNECTION_STATUS") {
58 | val isConnected = intent.getBooleanExtra("EXTRA_CONNECTION_STATUS", false)
59 | val notification: Notification = createNotification(isConnected)
60 | startForeground(NOTIFICATION_ID, notification)
61 | }
62 | }
63 | }
64 |
65 | override fun onBind(intent: Intent): IBinder? {
66 | // Return null if you don't need to bind the service
67 | return null
68 | }
69 |
70 | private fun createNotificationChannel() {
71 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
72 | val channel = NotificationChannel(
73 | CHANNEL_ID,
74 | "Foreground Service Channel",
75 | NotificationManager.IMPORTANCE_HIGH
76 | )
77 | channel.setSound(null, null) // Remove sound for the notification
78 | channel.enableVibration(false) // Disable vibration for the notification
79 | val manager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
80 | manager.createNotificationChannel(channel)
81 | }
82 | }
83 |
84 | private fun createNotification(isConnected:Boolean): Notification {
85 | val notificationBuilder = NotificationCompat.Builder(this, CHANNEL_ID)
86 | .setContentTitle("Noa Service")
87 | .setContentText(if (isConnected) "Listening.." else "Disconnected! Trying to connect.")
88 | .setSmallIcon(R.drawable.logo_button)
89 | // .setColor("#E82E87".toInt())
90 |
91 | // Customize the notification as needed
92 | // Set the priority to PRIORITY_LOW or PRIORITY_MIN to make it less intrusive
93 | .setPriority(NotificationCompat.PRIORITY_DEFAULT)
94 | // Set the category to CATEGORY_SERVICE to indicate that it's a background service
95 | .setCategory(NotificationCompat.CATEGORY_SERVICE)
96 |
97 | return notificationBuilder.build()
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/app/src/main/res/values-night/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Noa
3 | Home
4 | Dashboard
5 | Notifications
6 |
7 | Choose the device role:
8 | Peripheral/Server
9 | Central/Client
10 | scan
11 | Advertise Device
12 | Notify Client
13 | Peripheral/Server screen
14 | Central/Client screen
15 | Bluetooth is not supported on this device.
16 | Bluetooth Advertisements are not supported on this device.
17 | User declined to enable Bluetooth.
18 | User declined to permit ACCESS_COARSE_LOCATION.
19 | Scanning already started.
20 | Scanning for
21 | seconds.
22 | No devices found - refresh to try again.
23 | Advertising stopped due to timeout.
24 | Unknown error.
25 | connect
26 | Connected
27 | Disconnected
28 | Central Connection screen
29 | Connection Status
30 | Connected Device Name
31 | Server Characteristic value
32 | An error occurred when connecting to a device. Error Code
33 | Choose color
34 | Request Characteristic
35 | Characteristic value received: %1$d
36 | SearchActivity
37 | Dummy Button
38 | DUMMY\nCONTENT
39 | > Brilliant (Labs)
40 | Noa
41 | Let\'s pair your device. Take your Monocle out of the case, and bring it close.
42 | Bring your device close.
43 | Searching
44 | Next, enter your OpenAI developer API key. If you don\'t have one. You can sign up here
45 | Enter your api key
46 | Ask a question
47 | Be sure to read our Privacy Policy, as well as\n Terms and Conditions before using arGPT
48 | Be sure to read our Privacy Policy]]>, as well as Terms and Conditions]]> before using arGPT
49 |
50 | Be sure to read our Privacy Policy, as well as\n Terms and Conditions before using arGPT
51 |
52 | Hello blank fragment
53 |
54 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/popup_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
22 |
23 |
30 |
31 |
35 |
36 |
43 |
44 |
45 |
49 |
50 |
57 |
58 |
65 |
66 |
70 |
71 |
77 |
78 |
79 |
80 |
81 |
85 |
94 |
95 |
102 |
103 |
107 |
108 |
115 |
116 |
117 |
118 |
--------------------------------------------------------------------------------
/app/src/main/assets/Scripts/main.py:
--------------------------------------------------------------------------------
1 | import bluetooth
2 | import camera,_camera
3 | import graphics
4 | import microphone
5 | import touch
6 | import states
7 | from audio import *
8 | from photo import *
9 |
10 | state = states.State()
11 | gfx = graphics.Graphics()
12 |
13 | def bluetooth_send_message(message):
14 | while True:
15 | try:
16 | bluetooth.send(message)
17 | break
18 | except OSError:
19 | pass
20 |
21 | def bluetooth_message_handler(message):
22 | if state.current_state == state.WaitForPing:
23 | if message.startswith("pin:"):
24 | bluetooth_send_message(b"pon:" + message[4:])
25 | state.after(0, state.WaitForResponse)
26 | elif message.startswith("res:") or message.startswith("err:"):
27 | print_response(message)
28 | elif message.startswith("ick:"):
29 | state.after(0, state.WaitForTap)
30 |
31 | elif state.current_state == state.WaitForResponse:
32 | if message.startswith("res:") or message.startswith("err:"):
33 | print_response(message)
34 |
35 | elif state.current_state == state.PrintResponse:
36 | gfx.append_response(message[4:].decode("utf-8"))
37 |
38 | elif state.current_state == state.WaitForTap:
39 | if message.startswith("res:") or message.startswith("err:"):
40 | print_response(message)
41 |
42 | def touch_pad_handler(_):
43 | if state.current_state == state.WaitForTap:
44 | state.after(0, state.DetectSingleTap)
45 | elif (
46 | state.current_state == state.WaitForPing
47 | or state.current_state == state.WaitForResponse
48 | ):
49 | state.after(0, state.AskToCancel)
50 | elif state.current_state == state.AskToCancel:
51 | state.after(0, state.WaitForTap)
52 |
53 | def print_response(message):
54 | gfx.error_flag = message.startswith("err:")
55 | gfx.append_response(message[4:].decode("utf-8"))
56 | state.after(0, state.PrintResponse)
57 |
58 | bluetooth.receive_callback(bluetooth_message_handler)
59 | touch.callback(touch.EITHER, touch_pad_handler)
60 |
61 | while True:
62 | if state.current_state == state.Init:
63 | state.after(0, state.Welcome)
64 |
65 | elif state.current_state == state.Welcome:
66 | if state.on_entry():
67 | gfx.append_response(
68 | """Welcome to Noa for Monocle.\nStart the Noa iOS or Android app."""
69 | )
70 | if bluetooth.connected():
71 | state.after(5000, state.Connected)
72 |
73 | elif state.current_state == state.Connected:
74 | if state.on_entry():
75 | gfx.clear_response()
76 | gfx.set_prompt("Connected")
77 | state.after(2000, state.WaitForTap)
78 |
79 | elif state.current_state == state.WaitForTap:
80 | if state.on_entry():
81 | bluetooth_send_message(b"rdy:")
82 | gfx.set_prompt("Tap and speak")
83 |
84 | elif state.current_state == state.DetectSingleTap:
85 | if state.has_been() >= 250:
86 | if touch.state(touch.EITHER): # still holding, try detect hold
87 | state.after(0, state.DetectHold)
88 | _camera.wake()
89 | else:
90 | state.after(0, state.StartRecording)
91 |
92 | elif state.current_state == state.DetectHold:
93 | if state.has_been() >= 1000 and touch.state(touch.EITHER):
94 | state.after(0, state.CaptureImage)
95 | elif not touch.state(touch.EITHER):
96 | _camera.sleep()
97 | state.after(0, state.WaitForTap)
98 |
99 | elif state.current_state == state.StartRecording:
100 | start_recording(state, gfx, bluetooth_send_message)
101 |
102 | elif state.current_state == state.SendAudio:
103 | send_audio(state, gfx, bluetooth_send_message)
104 |
105 | elif (
106 | state.current_state == state.WaitForPing
107 | or state.current_state == state.WaitForResponse
108 | ):
109 | gfx.set_prompt("Waiting for openAI")
110 |
111 | elif state.current_state == state.AskToCancel:
112 | gfx.set_prompt("Cancel?")
113 | state.after(3000, state.previous_state)
114 |
115 | elif state.current_state == state.PrintResponse:
116 | gfx.set_prompt("")
117 | if gfx.done_printing:
118 | state.after(0, state.WaitForTap)
119 |
120 | elif state.current_state == state.CaptureImage:
121 | capture_image(state, gfx, bluetooth_send_message)
122 |
123 | elif state.current_state == state.SendImage:
124 | send_image(state, gfx, bluetooth_send_message)
125 |
126 | gfx.run()
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_chat_gpt.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
17 |
18 |
30 |
38 |
39 |
40 |
47 |
54 |
55 |
56 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
87 |
88 |
89 |
97 |
98 |
99 |
114 |
115 |
125 |
126 |
127 |
128 |
129 |
--------------------------------------------------------------------------------
/app/src/main/java/xyz/brilliant/argpt/ui/fragment/ScanningFragment.kt:
--------------------------------------------------------------------------------
1 | package xyz.brilliant.argpt.ui.fragment
2 |
3 | import android.content.Context
4 | import android.content.Intent
5 | import android.graphics.Color
6 | import android.net.Uri
7 | import android.os.Build
8 | import android.os.Bundle
9 | import android.text.Html
10 | import android.text.Spannable
11 | import android.text.SpannableString
12 | import android.text.Spanned
13 | import android.text.method.LinkMovementMethod
14 | import android.text.style.ClickableSpan
15 | import android.text.style.ForegroundColorSpan
16 | import android.view.LayoutInflater
17 | import android.view.View
18 | import android.view.ViewGroup
19 | import android.view.ViewTreeObserver
20 | import android.widget.Button
21 | import android.widget.RelativeLayout
22 | import android.widget.TextView
23 | import androidx.cardview.widget.CardView
24 | import androidx.fragment.app.Fragment
25 | import xyz.brilliant.argpt.R
26 | import xyz.brilliant.argpt.ui.activity.BaseActivity
27 |
28 |
29 | class ScanningFragment : Fragment() {
30 |
31 | private lateinit var parentActivity: BaseActivity
32 | private lateinit var deviceCloseTextView: TextView
33 | private lateinit var popUpbtn: TextView
34 | private lateinit var myCardView: CardView
35 | private lateinit var searchBox: RelativeLayout
36 |
37 | override fun onAttach(context: Context) {
38 | super.onAttach(context)
39 | parentActivity = context as BaseActivity
40 | }
41 |
42 |
43 | fun updatePopUp(deviceCloseText: String,buttonText:String){
44 | parentActivity.runOnUiThread {
45 | deviceCloseTextView.text = deviceCloseText
46 | popUpbtn.text = buttonText
47 | popUpbtn.isClickable=false
48 | }
49 | }
50 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
51 | super.onViewCreated(view, savedInstanceState)
52 |
53 | myCardView = view.findViewById(R.id.myCardView)
54 | popUpbtn = view.findViewById(R.id.popUpbtn)
55 | deviceCloseTextView = view.findViewById(R.id.deviceCloseTextView)
56 | searchBox = view.findViewById(R.id.searchBox)
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 | myCardView.translationY = myCardView.height.toFloat()
65 |
66 | val preDrawListener = object : ViewTreeObserver.OnPreDrawListener {
67 | override fun onPreDraw(): Boolean {
68 | myCardView.viewTreeObserver.removeOnPreDrawListener(this)
69 | myCardView.animate().translationY(-200f).setDuration(1000).start()
70 | return true
71 | }
72 | }
73 |
74 | myCardView.viewTreeObserver.addOnPreDrawListener(preDrawListener)
75 |
76 | searchBox.setOnClickListener {
77 | try {
78 | if (popUpbtn.text == "Monocle. Connect") {
79 | parentActivity.connectDevice()
80 | }
81 | }catch (ex:Exception){
82 | ex.printStackTrace()
83 | }
84 | }
85 | }
86 |
87 |
88 | override fun onCreateView(
89 | inflater: LayoutInflater, container: ViewGroup?,
90 | savedInstanceState: Bundle?
91 | ): View? {
92 | val view = inflater.inflate(R.layout.activity_pairing_screen, container, false)
93 |
94 | val nextPageButton = view.findViewById