├── app
├── .gitignore
├── src
│ └── main
│ │ ├── ic_launcher-playstore.png
│ │ ├── res
│ │ ├── drawable
│ │ │ ├── ic_calculator.png
│ │ │ ├── rect.xml
│ │ │ ├── notes_background.xml
│ │ │ ├── round_rect.xml
│ │ │ ├── round_square.xml
│ │ │ ├── running_indicator.xml
│ │ │ ├── dock_handle_bg_end.xml
│ │ │ ├── corner_background.xml
│ │ │ ├── dock_handle_bg_start.xml
│ │ │ ├── circle.xml
│ │ │ ├── search_background.xml
│ │ │ ├── ic_recents.xml
│ │ │ ├── ic_maximized.xml
│ │ │ ├── ic_back.xml
│ │ │ ├── ic_notification_clear_all.xml
│ │ │ ├── ic_pin.xml
│ │ │ ├── ic_standard.xml
│ │ │ ├── ic_arrow_back.xml
│ │ │ ├── ic_expand_left.xml
│ │ │ ├── ic_expand_right.xml
│ │ │ ├── ic_uninstall.xml
│ │ │ ├── ic_arrow_right.xml
│ │ │ ├── ic_audio_music.xml
│ │ │ ├── ic_wifi_on.xml
│ │ │ ├── ic_screen.xml
│ │ │ ├── ic_folder.xml
│ │ │ ├── ic_fullscreen.xml
│ │ │ ├── battery_full.xml
│ │ │ ├── ic_sounds.xml
│ │ │ ├── ic_overlay.xml
│ │ │ ├── ic_screencap.xml
│ │ │ ├── ic_notifications.xml
│ │ │ ├── ic_launch_mode.xml
│ │ │ ├── ic_unpin.xml
│ │ │ ├── ic_bluetooth.xml
│ │ │ ├── battery_empty.xml
│ │ │ ├── ic_add_to_desktop.xml
│ │ │ ├── ic_home.xml
│ │ │ ├── ic_portrait.xml
│ │ │ ├── battery_charging_full.xml
│ │ │ ├── ic_bluetooth_off.xml
│ │ │ ├── ic_alert.xml
│ │ │ ├── ic_expand_up_circle.xml
│ │ │ ├── ic_wifi_off.xml
│ │ │ ├── battery_charging_empty.xml
│ │ │ ├── ic_info.xml
│ │ │ ├── ic_power.xml
│ │ │ ├── ic_volume.xml
│ │ │ ├── ic_restart.xml
│ │ │ ├── ic_remove_from_desktop.xml
│ │ │ ├── ic_search.xml
│ │ │ ├── ic_granted.xml
│ │ │ ├── battery_20.xml
│ │ │ ├── battery_30.xml
│ │ │ ├── battery_50.xml
│ │ │ ├── battery_60.xml
│ │ │ ├── battery_80.xml
│ │ │ ├── battery_90.xml
│ │ │ ├── ic_dock.xml
│ │ │ ├── ic_notifications_off.xml
│ │ │ ├── ic_star.xml
│ │ │ ├── ic_soft_restart.xml
│ │ │ ├── ic_lock.xml
│ │ │ ├── ic_device_admin.xml
│ │ │ ├── ic_root.xml
│ │ │ ├── ic_screenshot.xml
│ │ │ ├── ic_wallpaper.xml
│ │ │ ├── battery_charging_20.xml
│ │ │ ├── battery_charging_30.xml
│ │ │ ├── battery_charging_60.xml
│ │ │ ├── battery_charging_80.xml
│ │ │ ├── battery_charging_90.xml
│ │ │ ├── ic_keyboard.xml
│ │ │ ├── battery_charging_50.xml
│ │ │ ├── ic_assistant.xml
│ │ │ ├── ic_corners.xml
│ │ │ ├── ic_desktop.xml
│ │ │ ├── ic_usage_stats.xml
│ │ │ ├── ic_screen_rotation_on.xml
│ │ │ ├── ic_remove_favorite.xml
│ │ │ ├── ic_add_favorite.xml
│ │ │ ├── ic_advanced.xml
│ │ │ ├── ic_manage.xml
│ │ │ ├── ic_hide.xml
│ │ │ ├── ic_accessibility.xml
│ │ │ ├── ic_touch_mode.xml
│ │ │ ├── ic_user.xml
│ │ │ ├── ic_screen_rotation_off.xml
│ │ │ ├── ic_freeze.xml
│ │ │ ├── ic_apps_menu.xml
│ │ │ ├── ic_shortcuts.xml
│ │ │ ├── ic_appearance.xml
│ │ │ ├── ic_secure_settings.xml
│ │ │ ├── ic_launcher_foreground.xml
│ │ │ └── ic_settings.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
│ │ ├── xml
│ │ │ ├── device_admin.xml
│ │ │ ├── preferences_desktop.xml
│ │ │ ├── accessibility_service.xml
│ │ │ ├── preferences_hot_corners.xml
│ │ │ ├── preferences_sounds.xml
│ │ │ ├── preferences_default_apps.xml
│ │ │ ├── preferences_help_about.xml
│ │ │ ├── preferences_appearance.xml
│ │ │ ├── preferences_notification.xml
│ │ │ ├── preferences_main.xml
│ │ │ ├── preferences_keyboard.xml
│ │ │ └── preferences_app_menu.xml
│ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ ├── values
│ │ │ ├── ic_launcher_background.xml
│ │ │ ├── arrays.xml
│ │ │ └── colors.xml
│ │ ├── values-sw360dp
│ │ │ └── values-preference.xml
│ │ ├── anim
│ │ │ ├── fade_out.xml
│ │ │ ├── fade_in.xml
│ │ │ ├── slide_down.xml
│ │ │ ├── slide_left.xml
│ │ │ └── slide_up.xml
│ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher_round.xml
│ │ │ └── ic_launcher.xml
│ │ ├── layout
│ │ │ ├── activity_settings.xml
│ │ │ ├── dock_handle.xml
│ │ │ ├── app_chooser_list.xml
│ │ │ ├── color_entry.xml
│ │ │ ├── dialog_edit_autostart.xml
│ │ │ ├── task_list.xml
│ │ │ ├── dialog_icon_blacklist.xml
│ │ │ ├── preference_file_chooser.xml
│ │ │ ├── dialog_display_size.xml
│ │ │ ├── preference_switch.xml
│ │ │ ├── preference_slider.xml
│ │ │ ├── dialog_help.xml
│ │ │ ├── preference_configurable_switch.xml
│ │ │ ├── audio_panel.xml
│ │ │ ├── toast.xml
│ │ │ ├── app_chooser_entry.xml
│ │ │ ├── preference_header.xml
│ │ │ ├── app_entry_large.xml
│ │ │ ├── app_entry.xml
│ │ │ ├── dialog_auto_pin.xml
│ │ │ ├── context_menu_entry.xml
│ │ │ ├── app_task_entry.xml
│ │ │ ├── activity_launcher.xml
│ │ │ ├── dialog_permissions.xml
│ │ │ ├── pin_entry.xml
│ │ │ ├── dialog_color_picker.xml
│ │ │ ├── notification_entry.xml
│ │ │ └── power_menu.xml
│ │ ├── menu
│ │ │ ├── menu_main.xml
│ │ │ ├── menu_desktop.xml
│ │ │ └── app_menu.xml
│ │ ├── layout-port
│ │ │ └── activity_launcher.xml
│ │ └── values-night
│ │ │ └── themes.xml
│ │ └── java
│ │ └── cu
│ │ └── axel
│ │ └── smartdock
│ │ ├── models
│ │ ├── Action.kt
│ │ ├── AppTask.kt
│ │ ├── App.kt
│ │ └── DockApp.kt
│ │ ├── activities
│ │ ├── SecondaryLauncherActivity.kt
│ │ └── DebugActivity.kt
│ │ ├── db
│ │ ├── DatabaseContract.kt
│ │ └── DBHelper.kt
│ │ ├── fragments
│ │ ├── PreferencesFragment.kt
│ │ ├── DesktopPreferences.kt
│ │ ├── KeyboardPreferences.kt
│ │ ├── DefaultAppsPreferences.kt
│ │ ├── HotCornersPreferences.kt
│ │ ├── NotificationPreferences.kt
│ │ ├── HelpAboutPreferences.kt
│ │ └── SoundsPreferences.kt
│ │ ├── widgets
│ │ └── HoverInterceptorLayout.kt
│ │ ├── preferences
│ │ ├── PreferenceHeader.kt
│ │ ├── SliderPreference.kt
│ │ ├── FileChooserPreference.kt
│ │ ├── NavActionChooserPreference.kt
│ │ ├── AppChooserPreference.kt
│ │ └── IconPackPreference.kt
│ │ ├── receivers
│ │ ├── SoundEventsReceiver.kt
│ │ └── BatteryStatsReceiver.kt
│ │ ├── adapters
│ │ ├── AppTaskAdapter.kt
│ │ ├── DisplaysAdapter.kt
│ │ ├── AppActionsAdapter.kt
│ │ └── AppShortcutAdapter.kt
│ │ ├── utils
│ │ ├── OnSwipeListener.kt
│ │ └── DeepShortcutManager.kt
│ │ ├── App.kt
│ │ └── dialogs
│ │ └── DockLayoutDialog.kt
├── proguard-rules.pro
└── build.gradle
├── fastlane
└── metadata
│ └── android
│ └── en-US
│ ├── title.txt
│ ├── short_description.txt
│ ├── images
│ └── phoneScreenshots
│ │ └── 1.png
│ ├── changelogs
│ ├── 1141.txt
│ ├── 198.txt
│ ├── 1100.txt
│ ├── 1140.txt
│ ├── 1110.txt
│ ├── 1121.txt
│ ├── 1120.txt
│ └── 1130.txt
│ └── full_description.txt
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .idea
├── vcs.xml
├── compiler.xml
├── kotlinc.xml
├── deploymentTargetDropDown.xml
├── migrations.xml
├── misc.xml
└── gradle.xml
├── .gitignore
├── settings.gradle
├── Contributors.md
├── .github
└── workflows
│ ├── build_project.yml
│ └── build_debug_apk.yml
├── gradle.properties
├── HideNav.md
├── README.md
├── gradlew.bat
└── CONTRIBUTING.md
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/title.txt:
--------------------------------------------------------------------------------
1 | Smart Dock
2 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/axel358/smartdock/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-playstore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/axel358/smartdock/HEAD/app/src/main/ic_launcher-playstore.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_calculator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/axel358/smartdock/HEAD/app/src/main/res/drawable/ic_calculator.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/axel358/smartdock/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/axel358/smartdock/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/models/Action.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.models
2 |
3 | class Action(val icon: Int, val text: String)
4 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/axel358/smartdock/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/axel358/smartdock/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/xml/device_admin.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/short_description.txt:
--------------------------------------------------------------------------------
1 | A user-friendly desktop mode launcher that offers a modern and customizable user interface
2 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/axel358/smartdock/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/axel358/smartdock/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/axel358/smartdock/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/axel358/smartdock/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/axel358/smartdock/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/axel358/smartdock/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/activities/SecondaryLauncherActivity.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.activities
2 |
3 | class SecondaryLauncherActivity : LauncherActivity()
4 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/axel358/smartdock/HEAD/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png
--------------------------------------------------------------------------------
/app/src/main/res/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #0065F2
4 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/rect.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/changelogs/1141.txt:
--------------------------------------------------------------------------------
1 | - Fix notification count text color on dark theme
2 | - Fix notification list scroll position resetting on notification panel updates
3 | - Fix dock app list scroll position resetting on dock updates
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/models/AppTask.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.models
2 |
3 | import android.graphics.drawable.Drawable
4 | class AppTask(val id: Int, label: String, packageName: String, icon: Drawable) : App(label, packageName, icon)
5 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/changelogs/198.txt:
--------------------------------------------------------------------------------
1 | Fix Bluetooth related crashes
2 | Fix some features not working until their respective settings page was open
3 | Port to Material 3
4 | Better power menu positioning
5 | Partially fix icon pack support
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values-sw360dp/values-preference.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | false
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/notes_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/round_rect.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/round_square.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/running_indicator.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.idea/deploymentTargetDropDown.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Aug 30 15:20:07 CST 2021
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/changelogs/1100.txt:
--------------------------------------------------------------------------------
1 | - Improved support for small and medium screens
2 | - Dynamic colors on Android 12+
3 | - Simplified settings
4 | - Better first time setup experience
5 | - Option to center the apps menu
6 | - Improved gestures support
7 | - Better notification handling
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/full_description.txt:
--------------------------------------------------------------------------------
1 | Main features:
2 |
3 | * Very customizable, icons, colors, shapes, sounds
4 | * Multi window support
5 | * Keyboard shortcuts
6 | * Support for both desktop and tablet layouts
7 | * Compatible with all Android versions since Nougat, no root required
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 |
--------------------------------------------------------------------------------
/.idea/migrations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/dock_handle_bg_end.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/changelogs/1140.txt:
--------------------------------------------------------------------------------
1 | - Customizable hot corner actions
2 | - Customizable navigation buttons long press actions
3 | - Setting to display battery level next to the icon
4 | - Apps menu improvements by somerandoname
5 | - German translation by 666hwll
6 | - Chinese translation by MicroeasyOT0
--------------------------------------------------------------------------------
/app/src/main/res/drawable/corner_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/dock_handle_bg_start.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/circle.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/fade_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/fade_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/preferences_desktop.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_settings.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_down.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_left.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_up.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/search_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | dependencyResolutionManagement {
2 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
3 | repositories {
4 | google()
5 | mavenCentral()
6 | jcenter() // Warning: this repository is going to shut down soon
7 | maven { url 'https://jitpack.io' }
8 | }
9 | }
10 | rootProject.name = "smartdock"
11 | include ':app'
12 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dock_handle.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_recents.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_maximized.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/db/DatabaseContract.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.db
2 |
3 | import android.provider.BaseColumns
4 |
5 | class DatabaseContract private constructor() {
6 | object LaunchModesTable : BaseColumns {
7 | const val TABLE_NAME = "table_launch_modes"
8 | const val COLUMN_PACKAGE_NAME = "package_name"
9 | const val COLUMN_LAUNCH_MODE = "launch_mode"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_desktop.xml:
--------------------------------------------------------------------------------
1 |
14 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/changelogs/1110.txt:
--------------------------------------------------------------------------------
1 | - Support for enabling some advanced features through ADB
2 | - Redesigned and simplified settings
3 | - Simplified permissions dialog
4 | - New color picker dialog with more color presets
5 | - Setting for adjusting the handle's transparency
6 | - Improved performance on the app grid
7 | - New gestures: Swipe down to unpin and left for back
8 | - Settings for custom user name and avatar
--------------------------------------------------------------------------------
/app/src/main/res/layout/app_chooser_list.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/Contributors.md:
--------------------------------------------------------------------------------
1 | - [Kirandeep Maan](https://github.com/KSMaan45)
2 |
3 | - [utzcoz](https://github.com/utzcoz)
4 |
5 | - [Jose Ricardo](https://github.com/jr20xx)
6 |
7 | - [Jon West](https://github.com/electrikjesus)
8 |
9 | - [Ryan Gocal](https://github.com/rgocal)
10 |
11 | - [Fire7ly](https://github.com/Fire7ly)
12 |
13 | And all the amazing people in [this group](https://t.me/smartdock358) that has helped shaping SmartDock
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_back.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
13 |
14 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_notification_clear_all.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/fragments/PreferencesFragment.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.fragments
2 |
3 | import android.os.Bundle
4 | import androidx.preference.PreferenceFragmentCompat
5 | import cu.axel.smartdock.R
6 |
7 | class PreferencesFragment : PreferenceFragmentCompat() {
8 | override fun onCreatePreferences(arg0: Bundle?, arg1: String?) {
9 | setPreferencesFromResource(R.xml.preferences_main, arg1)
10 | }
11 | }
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/changelogs/1121.txt:
--------------------------------------------------------------------------------
1 | - Fix app management from their context menu
2 | - Fix launching apps from recents on MIUI
3 | - Fix restoring preferences
4 | - Fix SwitchPreference style on dark theme
5 | - Remove broken app animation preferences
6 | - Remove user context menu
7 | - Window management improvements
8 | - Simplify shortcut preferences
9 | - Improve detection of running tasks
10 | - Improve apps menu in full screen
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/fragments/DesktopPreferences.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.fragments
2 |
3 | import android.os.Bundle
4 | import androidx.preference.PreferenceFragmentCompat
5 | import cu.axel.smartdock.R
6 |
7 | class DesktopPreferences : PreferenceFragmentCompat() {
8 | override fun onCreatePreferences(arg0: Bundle?, arg1: String?) {
9 | setPreferencesFromResource(R.xml.preferences_desktop, arg1)
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_pin.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_standard.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/fragments/KeyboardPreferences.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.fragments
2 |
3 | import android.os.Bundle
4 | import androidx.preference.PreferenceFragmentCompat
5 | import cu.axel.smartdock.R
6 |
7 | class KeyboardPreferences : PreferenceFragmentCompat() {
8 | override fun onCreatePreferences(arg0: Bundle?, arg1: String?) {
9 | setPreferencesFromResource(R.xml.preferences_keyboard, arg1)
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_arrow_back.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_expand_left.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_expand_right.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_uninstall.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_arrow_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_audio_music.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/fragments/DefaultAppsPreferences.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.fragments
2 |
3 | import android.os.Bundle
4 | import androidx.preference.PreferenceFragmentCompat
5 | import cu.axel.smartdock.R
6 |
7 |
8 | class DefaultAppsPreferences : PreferenceFragmentCompat() {
9 | override fun onCreatePreferences(arg0: Bundle?, arg1: String?) {
10 | setPreferencesFromResource(R.xml.preferences_default_apps, arg1)
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_wifi_on.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/widgets/HoverInterceptorLayout.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.widgets
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.view.MotionEvent
6 | import android.widget.LinearLayout
7 |
8 | class HoverInterceptorLayout(context: Context, attrs: AttributeSet?) : LinearLayout(context, attrs) {
9 | override fun onInterceptHoverEvent(event: MotionEvent): Boolean {
10 | return true
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_screen.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_folder.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_fullscreen.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/battery_full.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_sounds.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_overlay.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_screencap.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/changelogs/1120.txt:
--------------------------------------------------------------------------------
1 | ## This version requires a clean installation
2 | - Target Android 14
3 | - Support for apps from work profiles
4 | - Setting to change handle position
5 | - Allow choosing the display to launch apps in from their context menu
6 | - New adaptive app icon
7 | - Experimental setting to change Dock height
8 | - Option to backup and restore settings
9 | - New Wi-Fi panel on Android 10 and up
10 | - Improved app menu performance
11 | - Icon pack support removed
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_notifications.xml:
--------------------------------------------------------------------------------
1 |
8 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launch_mode.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_unpin.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_bluetooth.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/models/App.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.models
2 |
3 | import android.content.ComponentName
4 | import android.graphics.drawable.Drawable
5 | import android.os.Process
6 | import android.os.UserHandle
7 |
8 | open class App(val name: String, val packageName: String, open val icon: Drawable,
9 | val componentName: ComponentName? = null, val userHandle: UserHandle = Process.myUserHandle()) {
10 | override fun toString(): String {
11 | return name
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/battery_empty.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_add_to_desktop.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_portrait.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/battery_charging_full.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_bluetooth_off.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/changelogs/1130.txt:
--------------------------------------------------------------------------------
1 | - Restore experimental, incomplete support for icon packs
2 | - Option to hide apps from the app grid
3 | - Ability to ignore notifications for specific apps on the notification panel
4 | - Setting to configure the amount of running apps shown depending on device orientation
5 | - Use symbolic icons for notifications
6 | - Simplify many preference names
7 | - Minor visual enhancements
8 | - Remove preferences that only worked on old Android versions
9 | - Fix a "2" badge showing on Dock apps when it shouldn't
--------------------------------------------------------------------------------
/app/src/main/res/layout/color_entry.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_alert.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_expand_up_circle.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_wifi_off.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_edit_autostart.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/battery_charging_empty.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_info.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_power.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_volume.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_restart.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/task_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/accessibility_service.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_remove_from_desktop.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_search.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_granted.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_icon_blacklist.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/battery_20.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/battery_30.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/battery_50.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/battery_60.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/battery_80.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/battery_90.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_dock.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_notifications_off.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_star.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_soft_restart.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_lock.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/preference_file_chooser.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_display_size.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_device_admin.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_root.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_screenshot.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_wallpaper.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/preference_switch.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/battery_charging_20.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/battery_charging_30.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/battery_charging_60.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/battery_charging_80.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/battery_charging_90.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_keyboard.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/preference_slider.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/battery_charging_50.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_assistant.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_corners.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_desktop.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/models/DockApp.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.models
2 |
3 | import android.graphics.drawable.Drawable
4 |
5 | class DockApp : App {
6 | val tasks: ArrayList
7 |
8 | constructor(name: String, packageName: String, icon: Drawable) : super(name, packageName, icon) {
9 | tasks = ArrayList()
10 | }
11 |
12 | constructor(task: AppTask) : super(task.name, task.packageName, task.icon) {
13 | tasks = ArrayList()
14 | tasks.add(task)
15 | }
16 |
17 | fun addTask(task: AppTask) {
18 | tasks.add(task)
19 | }
20 |
21 | override val icon: Drawable
22 | get() = if (tasks.size == 1) tasks[0].icon else super.icon
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_help.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
15 |
16 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/.github/workflows/build_project.yml:
--------------------------------------------------------------------------------
1 | name: Build project
2 |
3 | on:
4 | push:
5 | pull_request:
6 | branches: [ main ]
7 |
8 | jobs:
9 | build:
10 | runs-on: ubuntu-latest
11 |
12 | steps:
13 | - uses: actions/checkout@v3
14 | - name: set up JDK 17
15 | uses: actions/setup-java@v3
16 | with:
17 | java-version: '17'
18 | distribution: 'zulu'
19 | cache: gradle
20 |
21 | - name: Grant execute permissions for gradlew
22 | run: chmod +x gradlew
23 | - name: Build project with Gradle
24 | run: ./gradlew build
25 | - name: Upload logs
26 | uses: actions/upload-artifact@v4
27 | with:
28 | name: lint-logs
29 | path: app/build/reports/lint-results-debug.html
30 |
--------------------------------------------------------------------------------
/.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/cu/axel/smartdock/preferences/PreferenceHeader.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.preferences
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import androidx.preference.Preference
6 | import androidx.preference.PreferenceViewHolder
7 | import com.google.android.material.button.MaterialButton
8 | import cu.axel.smartdock.R
9 |
10 | class PreferenceHeader(context: Context, attrs: AttributeSet?) : Preference(context, attrs) {
11 | init {
12 | layoutResource = R.layout.preference_header
13 | }
14 | override fun onBindViewHolder(holder: PreferenceViewHolder) {
15 | super.onBindViewHolder(holder)
16 | val iconBtn = holder.findViewById(R.id.preference_icon_btn) as MaterialButton
17 | iconBtn.icon = icon
18 | }
19 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_usage_stats.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_screen_rotation_on.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.github/workflows/build_debug_apk.yml:
--------------------------------------------------------------------------------
1 | name: Build debug apk
2 |
3 | on:
4 | workflow_dispatch
5 |
6 | jobs:
7 | build:
8 | runs-on: ubuntu-latest
9 |
10 | steps:
11 | - uses: actions/checkout@v3
12 | - name: set up JDK 17
13 | uses: actions/setup-java@v3
14 | with:
15 | java-version: '17'
16 | distribution: 'zulu'
17 | cache: gradle
18 |
19 | - name: Grant execute permissions for gradlew
20 | run: chmod +x gradlew
21 |
22 | - name: Build project with Gradle
23 | run: ./gradlew build
24 |
25 | - name: Build debug apk
26 | run: ./gradlew assembleDebug
27 |
28 | - name: Upload debug apk
29 | uses: actions/upload-artifact@v4
30 | with:
31 | name: apk-debug
32 | path: app/build/outputs/apk/debug
33 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_remove_favorite.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/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/cu/axel/smartdock/receivers/SoundEventsReceiver.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.receivers
2 |
3 | import android.content.BroadcastReceiver
4 | import android.content.Context
5 | import android.content.Intent
6 | import android.hardware.usb.UsbManager
7 | import cu.axel.smartdock.utils.DeviceUtils
8 | import cu.axel.smartdock.utils.Utils
9 |
10 | class SoundEventsReceiver : BroadcastReceiver() {
11 | override fun onReceive(context: Context, intent: Intent) {
12 | when (intent.action) {
13 | UsbManager.ACTION_USB_DEVICE_ATTACHED -> DeviceUtils.playEventSound(context, "usb_sound")
14 | Intent.ACTION_POWER_CONNECTED -> {
15 | Utils.shouldPlayChargeComplete = true
16 | DeviceUtils.playEventSound(context, "charge_sound")
17 | }
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_add_favorite.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_advanced.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_manage.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/fragments/HotCornersPreferences.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.fragments
2 |
3 | import android.os.Bundle
4 | import android.text.InputType
5 | import android.view.inputmethod.EditorInfo
6 | import androidx.preference.EditTextPreference
7 | import androidx.preference.PreferenceFragmentCompat
8 | import cu.axel.smartdock.R
9 |
10 | class HotCornersPreferences : PreferenceFragmentCompat() {
11 | override fun onCreatePreferences(arg0: Bundle?, arg1: String?) {
12 | setPreferencesFromResource(R.xml.preferences_hot_corners, arg1)
13 |
14 | val activationDelay: EditTextPreference = findPreference("hot_corners_delay")!!
15 | activationDelay.setOnBindEditTextListener { editText ->
16 | editText.inputType = InputType.TYPE_CLASS_NUMBER
17 | editText.imeOptions = EditorInfo.IME_ACTION_GO
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_hide.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/preference_configurable_switch.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_accessibility.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/preferences_hot_corners.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
13 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_touch_mode.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_user.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_screen_rotation_off.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_freeze.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_apps_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
11 |
12 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | ## For more details on how to configure your build environment visit
2 | # http://www.gradle.org/docs/current/userguide/build_environment.html
3 | #
4 | # Specifies the JVM arguments used for the daemon process.
5 | # The setting is particularly useful for tweaking memory settings.
6 | # Default value: -Xmx1024m -XX:MaxPermSize=256m
7 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
8 | #
9 | # When configured, Gradle will run in incubating parallel mode.
10 | # This option should only be used with decoupled projects. More details, visit
11 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
12 | # org.gradle.parallel=true
13 | #Tue Feb 20 16:08:28 EST 2024
14 | android.enableJetifier=true
15 | android.nonFinalResIds=false
16 | android.nonTransitiveRClass=false
17 | android.useAndroidX=true
18 | org.gradle.jvmargs=-Xmx1536M -Dkotlin.daemon.jvm.options\="-Xmx1024M" -Dfile.encoding\=UTF-8
19 | #org.gradle.parallel.downloads=false
20 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/audio_panel.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
16 |
17 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_shortcuts.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/preferences_sounds.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
11 |
14 |
17 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/fragments/NotificationPreferences.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.fragments
2 |
3 | import android.os.Bundle
4 | import android.text.InputType
5 | import android.view.inputmethod.EditorInfo
6 | import androidx.preference.EditTextPreference
7 | import androidx.preference.PreferenceFragmentCompat
8 | import cu.axel.smartdock.R
9 |
10 | class NotificationPreferences : PreferenceFragmentCompat() {
11 | override fun onCreatePreferences(arg0: Bundle?, arg1: String?) {
12 | setPreferencesFromResource(R.xml.preferences_notification, arg1)
13 |
14 | val notificationTimeout: EditTextPreference = findPreference("notification_display_time")!!
15 | notificationTimeout.setOnBindEditTextListener { editText ->
16 | editText.inputType = InputType.TYPE_CLASS_NUMBER
17 | editText.imeOptions = EditorInfo.IME_ACTION_GO
18 | }
19 |
20 | notificationTimeout.setOnPreferenceChangeListener { _, newValue ->
21 | val value = newValue as String
22 | value.isNotEmpty() && value.toInt() > 0
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/toast.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
18 |
19 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/app_chooser_entry.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
14 |
15 |
23 |
24 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/preference_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
18 |
19 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_appearance.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/app_entry_large.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
19 |
20 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/app_entry.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
19 |
20 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_auto_pin.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
15 |
16 |
21 |
22 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/activities/DebugActivity.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.activities
2 |
3 | import android.content.Intent
4 | import android.os.Bundle
5 | import androidx.appcompat.app.AppCompatActivity
6 | import com.google.android.material.dialog.MaterialAlertDialogBuilder
7 | import cu.axel.smartdock.R
8 | import cu.axel.smartdock.utils.Utils
9 |
10 |
11 | class DebugActivity : AppCompatActivity() {
12 | override fun onCreate(savedInstanceState: Bundle?) {
13 | super.onCreate(savedInstanceState)
14 | val dialog = MaterialAlertDialogBuilder(this)
15 | dialog.setTitle(R.string.something_wrong)
16 | val report = intent.getStringExtra("report")!!
17 | dialog.setMessage(report)
18 | dialog.setPositiveButton(R.string.ok) { _, _ -> finish() }
19 | dialog.setNeutralButton(R.string.save_log) { _, _ ->
20 | Utils.saveLog(this, "crash_log", report)
21 | finish()
22 | }
23 | dialog.setNegativeButton(R.string.open_again) { _, _ ->
24 | startActivity(Intent(this, MainActivity::class.java))
25 | finish()
26 | }
27 | dialog.setCancelable(false)
28 | dialog.create().show()
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/context_menu_entry.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
21 |
22 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/adapters/AppTaskAdapter.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.adapters
2 |
3 | import android.content.Context
4 | import android.view.LayoutInflater
5 | import android.view.View
6 | import android.view.ViewGroup
7 | import android.widget.ArrayAdapter
8 | import android.widget.ImageView
9 | import android.widget.TextView
10 | import cu.axel.smartdock.R
11 | import cu.axel.smartdock.models.AppTask
12 | import cu.axel.smartdock.utils.ColorUtils
13 |
14 | class AppTaskAdapter(private val context: Context, tasks: ArrayList) : ArrayAdapter(context, R.layout.context_menu_entry, tasks) {
15 | override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
16 | var convertView = convertView
17 | if (convertView == null) convertView = LayoutInflater.from(context).inflate(R.layout.context_menu_entry, null)
18 | val icon = convertView!!.findViewById(R.id.menu_entry_iv)
19 | val text = convertView.findViewById(R.id.menu_entry_tv)
20 | val task = getItem(position)
21 | icon.setImageDrawable(task!!.icon)
22 | text.text = task.name
23 | ColorUtils.applyColor(icon, ColorUtils.getDrawableDominantColor(icon.drawable))
24 | return convertView
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/HideNav.md:
--------------------------------------------------------------------------------
1 | ### Hide Android navigation buttons:
2 |
3 | **With root:**
4 | - From Smart Dock advanced settings
5 | - Edit /system/build.prop and add qemu.hw.mainkeys=1
6 | - Run "echo qemu.hw.mainkeys=1 >> /system/build.prop"
7 |
8 | **Without root**
9 | - Mount the system partition on Linux, edit /system/build.prop and add qemu.hw.mainkeys=1
10 | - For waydroid users, from Linux run waydroid prop set qemu.hw.mainkeys 1
11 |
12 | **With LSPosed (might help on Android 11+):**
13 |
14 | - Install [initrd-magisk](https://github.com/HuskyDG/initrd-magisk) by HuskyDG following installation wiki.
15 |
16 | - Install [LSPosed](https://github.com/LSPosed/LSPosed/releases) using magisk manager.
17 | ([Riru](https://github.com/RikkaApps/Riru/releases) magisk module required for riru version of lsposed.)
18 |
19 | - Install and enable GravityBox from LSPosed modules repository, and reboot.
20 | (Make sure to choose suitable variant for running android version.)
21 |
22 | - Open GravityBox, go to;
23 | - Display tweaks > Expanded desktop mode,
24 | and choose "Hide navigation bar"
25 |
26 | - Now you can toggle expanded desktop mode from power menu.
27 | (use Ctrl+Alt+Del for power menu)
28 |
29 | *. Alternatively you can toggle Navigation bar tweaks from GravityBox and you can change height and width of navbar to 0%.
30 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/preferences/SliderPreference.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.preferences
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.view.LayoutInflater
6 | import androidx.preference.Preference
7 | import com.google.android.material.dialog.MaterialAlertDialogBuilder
8 | import com.google.android.material.slider.Slider
9 | import cu.axel.smartdock.R
10 |
11 | class SliderPreference(private val context: Context, attrs: AttributeSet?) : Preference(context, attrs) {
12 | private lateinit var listener: OnDialogShownListener
13 | lateinit var slider: Slider
14 | override fun onClick() {
15 | val dialog = MaterialAlertDialogBuilder(context)
16 | dialog.setTitle(title)
17 | val view = LayoutInflater.from(context).inflate(R.layout.preference_slider, null)
18 | slider = view.findViewById(R.id.preference_slider)
19 | dialog.setPositiveButton(R.string.ok, null)
20 | dialog.setView(view)
21 | dialog.show()
22 | if (::listener.isInitialized)
23 | listener.onDialogShown()
24 | }
25 |
26 | fun setOnDialogShownListener(listener: OnDialogShownListener) {
27 | this.listener = listener
28 | }
29 |
30 | interface OnDialogShownListener {
31 | fun onDialogShown()
32 | }
33 | }
--------------------------------------------------------------------------------
/app/src/main/res/xml/preferences_default_apps.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
11 |
14 |
17 |
20 |
23 |
26 |
27 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | id 'kotlin-android'
4 | }
5 |
6 | android {
7 | compileSdk 34
8 | namespace "cu.axel.smartdock"
9 |
10 | defaultConfig {
11 | applicationId "cu.axel.smartdock"
12 | minSdk 24
13 | targetSdk 34
14 | versionCode 1141
15 | versionName "1.14.1"
16 | signingConfig signingConfigs.debug
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23 | signingConfig signingConfigs.debug
24 | }
25 | }
26 | compileOptions {
27 | sourceCompatibility JavaVersion.VERSION_1_8
28 | targetCompatibility JavaVersion.VERSION_1_8
29 | }
30 | kotlinOptions {
31 | jvmTarget = '1.8'
32 | }
33 | dependenciesInfo {
34 | includeInApk true
35 | includeInBundle true
36 | }
37 | }
38 |
39 | dependencies {
40 | implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.9.20'
41 | implementation 'androidx.appcompat:appcompat:1.7.1'
42 | implementation 'com.google.android.material:material:1.12.0'
43 | implementation 'androidx.preference:preference-ktx:1.2.1'
44 | implementation 'com.github.ChickenHook:RestrictionBypass:2.2'
45 | }
46 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/adapters/DisplaysAdapter.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.adapters
2 |
3 | import android.content.Context
4 | import android.view.Display
5 | import android.view.LayoutInflater
6 | import android.view.View
7 | import android.view.ViewGroup
8 | import android.widget.ArrayAdapter
9 | import android.widget.ImageView
10 | import android.widget.TextView
11 | import androidx.preference.PreferenceManager
12 | import cu.axel.smartdock.R
13 | import cu.axel.smartdock.utils.ColorUtils
14 |
15 | class DisplaysAdapter(private val context: Context, displays: Array) : ArrayAdapter(context, R.layout.context_menu_entry, displays) {
16 | override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
17 | var convertView = convertView
18 | val display = getItem(position)
19 | if (convertView == null) convertView = LayoutInflater.from(context).inflate(R.layout.context_menu_entry, null)
20 | val icon = convertView!!.findViewById(R.id.menu_entry_iv)
21 | val text = convertView.findViewById(R.id.menu_entry_tv)
22 | ColorUtils.applySecondaryColor(context, PreferenceManager.getDefaultSharedPreferences(context), icon)
23 | text.text = display!!.name
24 | icon.setImageResource(R.drawable.ic_screen)
25 | return convertView
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_secure_settings.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/adapters/AppActionsAdapter.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.adapters
2 |
3 | import android.content.Context
4 | import android.view.LayoutInflater
5 | import android.view.View
6 | import android.view.ViewGroup
7 | import android.widget.ArrayAdapter
8 | import android.widget.ImageView
9 | import android.widget.TextView
10 | import androidx.preference.PreferenceManager
11 | import cu.axel.smartdock.R
12 | import cu.axel.smartdock.models.Action
13 | import cu.axel.smartdock.utils.ColorUtils
14 |
15 |
16 | class AppActionsAdapter(private val context: Context, actions: ArrayList) : ArrayAdapter(context, R.layout.context_menu_entry, actions) {
17 | override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
18 | var convertView = convertView
19 | val action = getItem(position)
20 | if (convertView == null) convertView = LayoutInflater.from(context).inflate(R.layout.context_menu_entry, null)
21 | val icon = convertView!!.findViewById(R.id.menu_entry_iv)
22 | val text = convertView.findViewById(R.id.menu_entry_tv)
23 | ColorUtils.applySecondaryColor(context, PreferenceManager.getDefaultSharedPreferences(context), icon)
24 | text.text = action!!.text
25 | icon.setImageResource(action.icon)
26 | return convertView
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/adapters/AppShortcutAdapter.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.adapters
2 |
3 | import android.annotation.SuppressLint
4 | import android.content.Context
5 | import android.content.pm.ShortcutInfo
6 | import android.view.LayoutInflater
7 | import android.view.View
8 | import android.view.ViewGroup
9 | import android.widget.ArrayAdapter
10 | import android.widget.ImageView
11 | import android.widget.TextView
12 | import cu.axel.smartdock.R
13 | import cu.axel.smartdock.utils.DeepShortcutManager
14 |
15 | class AppShortcutAdapter(private val context: Context, shortcuts: List) : ArrayAdapter(context, R.layout.context_menu_entry, shortcuts) {
16 | @SuppressLint("NewApi")
17 | override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
18 | var convertView = convertView
19 | if (convertView == null)
20 | convertView = LayoutInflater.from(context).inflate(R.layout.context_menu_entry, null)
21 | val icon = convertView!!.findViewById(R.id.menu_entry_iv)
22 | val text = convertView.findViewById(R.id.menu_entry_tv)
23 | val shortcut = getItem(position)!!
24 | icon!!.setImageDrawable(DeepShortcutManager.getShortcutIcon(shortcut, context))
25 | text!!.text = shortcut.shortLabel
26 | return convertView
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/preferences/FileChooserPreference.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.preferences
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import androidx.preference.Preference
6 | import androidx.preference.PreferenceViewHolder
7 | import com.google.android.material.button.MaterialButton
8 | import cu.axel.smartdock.R
9 |
10 | class FileChooserPreference(private val context: Context, attrs: AttributeSet?) : Preference(context, attrs) {
11 | init {
12 | setupPreference()
13 | }
14 |
15 | override fun onBindViewHolder(holder: PreferenceViewHolder) {
16 | super.onBindViewHolder(holder)
17 | val resetButton = holder.findViewById(R.id.fs_preference_reset_btn) as MaterialButton
18 | resetButton.setOnClickListener { setFile("default") }
19 | }
20 |
21 | private fun setupPreference() {
22 | widgetLayoutResource = R.layout.preference_file_chooser
23 | }
24 |
25 | fun setFile(file: String) {
26 | persistString(file)
27 | updateSummary()
28 | }
29 |
30 | override fun onAttached() {
31 | super.onAttached()
32 | updateSummary()
33 | }
34 |
35 | private fun updateSummary() {
36 | val file = sharedPreferences!!.getString(key, "default")
37 | summary = if (file == "default") context.getString(R.string.tap_to_set) else ""
38 | }
39 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
13 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/app_task_entry.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
19 |
20 |
26 |
27 |
37 |
38 |
39 |
40 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_settings.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/fragments/HelpAboutPreferences.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.fragments
2 |
3 | import android.content.ActivityNotFoundException
4 | import android.content.Intent
5 | import android.os.Bundle
6 | import androidx.core.net.toUri
7 | import androidx.preference.Preference
8 | import androidx.preference.PreferenceFragmentCompat
9 | import com.google.android.material.dialog.MaterialAlertDialogBuilder
10 | import cu.axel.smartdock.R
11 |
12 | class HelpAboutPreferences : PreferenceFragmentCompat() {
13 | override fun onCreatePreferences(arg0: Bundle?, arg1: String?) {
14 | setPreferencesFromResource(R.xml.preferences_help_about, arg1)
15 | findPreference("join_telegram")!!.setOnPreferenceClickListener {
16 | try {
17 | startActivity(Intent(Intent.ACTION_VIEW).setData("tg://resolve?domain=smartdock358".toUri()))
18 | } catch (_: ActivityNotFoundException) {
19 | }
20 | false
21 | }
22 | findPreference("show_help")!!.setOnPreferenceClickListener {
23 | val dialog = MaterialAlertDialogBuilder(requireContext())
24 | dialog.setTitle(R.string.help)
25 | dialog.setView(R.layout.dialog_help)
26 | dialog.setPositiveButton(R.string.ok, null)
27 | dialog.setNegativeButton(R.string.more_help) { _, _ -> startActivity(Intent(Intent.ACTION_VIEW,
28 | "https://github.com/axel358/smartdock".toUri())) }
29 | dialog.show()
30 | false
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/preferences_help_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
10 |
11 |
15 |
18 |
20 |
21 |
24 |
26 |
27 |
30 |
32 |
33 |
36 |
37 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/app_menu.xml:
--------------------------------------------------------------------------------
1 |
43 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/preferences_appearance.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
19 |
20 |
26 |
27 |
31 |
32 |
36 |
37 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_launcher.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
13 |
14 |
19 |
20 |
21 |
26 |
27 |
33 |
34 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/app/src/main/res/layout-port/activity_launcher.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
13 |
14 |
19 |
20 |
21 |
26 |
27 |
33 |
34 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_permissions.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
15 |
16 |
22 |
23 |
29 |
30 |
31 |
34 |
35 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/utils/OnSwipeListener.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.utils
2 |
3 | import android.view.GestureDetector
4 | import android.view.MotionEvent
5 | import kotlin.math.atan2
6 |
7 | open class OnSwipeListener : GestureDetector.SimpleOnGestureListener() {
8 | override fun onFling(e1: MotionEvent?, e2: MotionEvent, velocityX: Float, velocityY: Float): Boolean {
9 | if (e1 != null) {
10 | val x1 = e1.x
11 | val y1 = e1.y
12 | val x2 = e2.x
13 | val y2 = e2.y
14 | val direction = getDirection(x1, y1, x2, y2)
15 | return onSwipe(direction)
16 | }
17 | return false
18 | }
19 |
20 |
21 | open fun onSwipe(direction: Direction): Boolean {
22 | return false
23 | }
24 |
25 | private fun getDirection(x1: Float, y1: Float, x2: Float, y2: Float): Direction {
26 | val angle = getAngle(x1, y1, x2, y2)
27 | return Direction.fromAngle(angle)
28 | }
29 |
30 | private fun getAngle(x1: Float, y1: Float, x2: Float, y2: Float): Double {
31 | val rad = atan2((y1 - y2).toDouble(), (x2 - x1).toDouble()) + Math.PI
32 | return (rad * 180 / Math.PI + 180) % 360
33 | }
34 |
35 | enum class Direction {
36 | UP,
37 | DOWN,
38 | LEFT,
39 | RIGHT;
40 |
41 | companion object {
42 | fun fromAngle(angle: Double): Direction {
43 | return if (inRange(angle, 45f, 135f)) {
44 | UP
45 | } else if (inRange(angle, 0f, 45f) || inRange(angle, 315f, 360f)) {
46 | RIGHT
47 | } else if (inRange(angle, 225f, 315f)) {
48 | DOWN
49 | } else {
50 | LEFT
51 | }
52 | }
53 |
54 | private fun inRange(angle: Double, init: Float, end: Float): Boolean {
55 | return angle >= init && angle < end
56 | }
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/App.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock
2 |
3 | import android.app.AlarmManager
4 | import android.app.Application
5 | import android.app.PendingIntent
6 | import android.content.Intent
7 | import com.google.android.material.color.DynamicColors
8 | import cu.axel.smartdock.activities.DebugActivity
9 | import kotlin.system.exitProcess
10 | import android.os.Process
11 |
12 | class App : Application() {
13 | private lateinit var uncaughtExceptionHandler: Thread.UncaughtExceptionHandler
14 | override fun onCreate() {
15 | DynamicColors.applyToActivitiesIfAvailable(this)
16 | uncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler()!!
17 | Thread.setDefaultUncaughtExceptionHandler { thread, exception ->
18 | val report = StringBuilder("Exception: $exception\n")
19 | for (element in exception.stackTrace) report.append(element.toString()).append("\n")
20 | val cause = exception.cause
21 | if (cause != null) {
22 | report.append("Cause: ").append(cause).append("\n")
23 | for (element in cause.stackTrace) report.append(element.toString()).append("\n")
24 | }
25 | val message = exception.message
26 | if (message != null) report.append("Message: ").append(message)
27 | val intent = Intent(applicationContext, DebugActivity::class.java)
28 | intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
29 | intent.putExtra("report", report.toString())
30 | //startActivity(intent);
31 | val pendingIntent = PendingIntent.getActivity(applicationContext, 11111, intent, PendingIntent.FLAG_ONE_SHOT or PendingIntent.FLAG_IMMUTABLE)
32 | val am = getSystemService(ALARM_SERVICE) as AlarmManager
33 | am[AlarmManager.ELAPSED_REALTIME_WAKEUP, 1000] = pendingIntent
34 | Process.killProcess(Process.myPid())
35 | exitProcess(2)
36 | uncaughtExceptionHandler.uncaughtException(thread, exception)
37 | }
38 | super.onCreate()
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/receivers/BatteryStatsReceiver.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.receivers
2 |
3 | import android.content.BroadcastReceiver
4 | import android.content.Context
5 | import android.content.Intent
6 | import android.os.BatteryManager
7 | import android.widget.TextView
8 | import androidx.appcompat.content.res.AppCompatResources
9 | import cu.axel.smartdock.utils.DeviceUtils
10 | import cu.axel.smartdock.utils.Utils
11 |
12 | class BatteryStatsReceiver(
13 | private val context: Context,
14 | private val batteryBtn: TextView,
15 | var showLevel: Boolean
16 | ) : BroadcastReceiver() {
17 | var level = 0
18 |
19 | init {
20 | val batteryManager = context.getSystemService(Context.BATTERY_SERVICE) as BatteryManager
21 | level = batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY)
22 | update(batteryManager.isCharging)
23 | }
24 |
25 | override fun onReceive(context: Context, intent: Intent) {
26 | level = intent.extras!!.getInt("level")
27 | if (showLevel)
28 | batteryBtn.text = "$level%"
29 | update(intent.extras!!.getInt("plugged") == 0)
30 |
31 | }
32 |
33 | private fun update(isPlugged: Boolean) {
34 | if (isPlugged)
35 | batteryBtn.setCompoundDrawablesWithIntrinsicBounds(
36 | AppCompatResources.getDrawable(
37 | context,
38 | Utils.getBatteryDrawable(level, false)
39 | ), null, null, null
40 | )
41 | else {
42 | batteryBtn.setCompoundDrawablesWithIntrinsicBounds(
43 | AppCompatResources.getDrawable(
44 | context,
45 | Utils.getBatteryDrawable(level, true)
46 | ), null, null, null
47 | )
48 | if (level == 100) {
49 | if (Utils.shouldPlayChargeComplete)
50 | DeviceUtils.playEventSound(context, "charge_complete_sound")
51 | Utils.shouldPlayChargeComplete = false
52 | }
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
Smart Dock
3 | A user-friendly desktop mode launcher that offers a modern and customizable user interface
4 |
5 |
6 | 
7 |
8 | ## Main features
9 | - Very customizable, icons, colors, shapes, sounds
10 | - Multi window support
11 | - Keyboard shortcuts
12 | - Support for both desktop and tablet layouts
13 | - Compatible with all Android versions since Nougat, no root required
14 |
15 | ## Install
16 |
17 | [
](https://f-droid.org/packages/cu.axel.smartdock)
20 |
21 | You can grab the latest release from F-Droid
22 |
23 | Note: The application should be installed as a system app in order to obtain the right permissions.
24 | Without this functionality will be limited.
25 |
26 | ## Usage
27 |
28 | ### Grant restricted permissions:
29 | On some devices Accessibility and Notification permissions might not be available. To solve this go to: System Settings > Apps > Smartdock > 3 Dot menu (Top right corner) > Allow restricted permissions
30 |
31 | ### Secure settings
32 | To grant secure settings permissions run the following command on an adb or root shell:
33 | ```
34 | pm grant cu.axel.smartdock android.permission.WRITE_SECURE_SETTINGS
35 | ```
36 |
37 | ### Hide navigation bar
38 | You might also want to hide the Android navigation bar.
39 | [See hiding navigation bar](HideNav.md)
40 |
41 | The app uses an accessibility service to capture keyboard input, if that service is crashed you might need to re-enable it and/or restart the system.
42 |
43 | ## Get help and ask questions
44 |
45 | Telegram support group: https://t.me/smartdock358
46 |
47 | ## Support the project
48 |
49 | If you find this project useful or it has helped you in any way, consider showing your appreciation and supporting its ongoing development.
50 |
51 | Bitcoin Address:
52 | ```
53 | bc1qqdxea9mx536a333zwv067uc3pww6pdxz3yat8l
54 | ```
55 |
56 | Thank you for your support!
57 |
58 | ## Contributors
59 |
60 | [See contributors](Contributors.md)
61 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/dialogs/DockLayoutDialog.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.dialogs
2 |
3 | import android.content.Context
4 | import androidx.preference.PreferenceManager
5 | import com.google.android.material.dialog.MaterialAlertDialogBuilder
6 | import cu.axel.smartdock.R
7 |
8 | class DockLayoutDialog(context: Context) : MaterialAlertDialogBuilder(context) {
9 | init {
10 | val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
11 | val editor = sharedPreferences.edit()
12 | setTitle(R.string.choose_dock_layout)
13 | val layout = sharedPreferences.getInt("dock_layout", -1)
14 | setSingleChoiceItems(R.array.layouts, layout) { _, which ->
15 | editor.putBoolean("enable_nav_back", which != 0)
16 | editor.putBoolean("enable_nav_home", which != 0)
17 | editor.putBoolean("enable_nav_recents", which != 0)
18 | editor.putBoolean("enable_qs_wifi", which != 0)
19 | editor.putBoolean("enable_qs_vol", which != 0)
20 | editor.putBoolean("enable_qs_date", which != 0)
21 | editor.putBoolean("enable_qs_notif", which != 0)
22 | editor.putBoolean("app_menu_fullscreen", which != 2)
23 | editor.putString("launch_mode", if (which != 2) "fullscreen" else "standard")
24 | editor.putString(
25 | "max_running_apps", when (which) {
26 | 0 -> "4"
27 | 1 -> "10"
28 | else -> "15"
29 | }
30 | )
31 | editor.putString(
32 | "max_running_apps_landscape", when (which) {
33 | 0 -> "8"
34 | 1 -> "10"
35 | else -> "15"
36 | }
37 | )
38 | editor.putString("dock_activation_area", if (which == 2) "5" else "25")
39 | editor.putInt("dock_layout", which)
40 | editor.putString("activation_method", if (which != 2) "handle" else "swipe")
41 | editor.putBoolean("show_notifications", which != 0)
42 | editor.putBoolean("enable_qs_pin", which != 2)
43 | editor.apply()
44 | }
45 | setPositiveButton(R.string.ok, null)
46 | show()
47 | }
48 | }
--------------------------------------------------------------------------------
/app/src/main/res/xml/preferences_notification.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
14 |
19 |
20 |
25 |
26 |
30 |
31 |
32 |
36 |
39 |
40 |
41 |
42 |
43 |
44 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/utils/DeepShortcutManager.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.utils
2 |
3 | import android.annotation.TargetApi
4 | import android.content.Context
5 | import android.content.pm.LauncherApps
6 | import android.content.pm.ShortcutInfo
7 | import android.graphics.drawable.Drawable
8 | import android.os.Build
9 | import android.os.Process
10 |
11 | /**
12 | * Performs operations related to deep shortcuts, such as querying for them, pinning them, etc.
13 | */
14 | object DeepShortcutManager {
15 | //TODO: Add free form support
16 | @TargetApi(25)
17 | fun startShortcut(shortcutInfo: ShortcutInfo, context: Context) {
18 | val launcherApps = context.getSystemService(Context.LAUNCHER_APPS_SERVICE) as LauncherApps
19 | try {
20 | launcherApps.startShortcut(shortcutInfo.getPackage(), shortcutInfo.id, null, null,
21 | Process.myUserHandle())
22 | } catch (_: Exception) {
23 | }
24 | }
25 |
26 | @TargetApi(25)
27 | fun getShortcutIcon(shortcutInfo: ShortcutInfo, context: Context): Drawable? {
28 | val launcherApps = context.getSystemService(Context.LAUNCHER_APPS_SERVICE) as LauncherApps
29 | try {
30 | val density = context.resources.displayMetrics.density * 48
31 | return launcherApps.getShortcutIconDrawable(shortcutInfo, density.toInt())
32 | } catch (_: Exception) {
33 | }
34 | return null
35 | }
36 |
37 | @TargetApi(25)
38 | fun getShortcuts(app: String, context: Context): List? {
39 | val launcherApps = context.getSystemService(Context.LAUNCHER_APPS_SERVICE) as LauncherApps
40 | val queryParams = LauncherApps.ShortcutQuery()
41 | queryParams.setQueryFlags(
42 | LauncherApps.ShortcutQuery.FLAG_MATCH_MANIFEST or LauncherApps.ShortcutQuery.FLAG_MATCH_DYNAMIC)
43 | queryParams.setPackage(app)
44 | return try {
45 | launcherApps.getShortcuts(queryParams, Process.myUserHandle())
46 | } catch (_: Exception) {
47 | null
48 | }
49 | }
50 |
51 | fun hasHostPermission(context: Context): Boolean {
52 | val launcherApps = context.getSystemService(Context.LAUNCHER_APPS_SERVICE) as LauncherApps
53 | return Build.VERSION.SDK_INT > 24 && launcherApps.hasShortcutHostPermission()
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/pin_entry.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
23 |
24 |
33 |
34 |
35 |
36 |
44 |
45 |
52 |
53 |
61 |
62 |
69 |
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/preferences/NavActionChooserPreference.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.preferences
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import androidx.preference.Preference
6 | import androidx.preference.PreferenceViewHolder
7 | import com.google.android.material.button.MaterialButton
8 | import com.google.android.material.dialog.MaterialAlertDialogBuilder
9 | import com.google.android.material.materialswitch.MaterialSwitch
10 | import cu.axel.smartdock.R
11 | import androidx.core.content.edit
12 |
13 | val NAV_LONG_ACTIONS = listOf("none", "notifications", "assistant", "lock", "split")
14 |
15 | class NavActionChooserPreference(private val context: Context, attrs: AttributeSet?) :
16 | Preference(context, attrs) {
17 |
18 | init {
19 | setupPreference()
20 | }
21 |
22 | override fun onBindViewHolder(holder: PreferenceViewHolder) {
23 | super.onBindViewHolder(holder)
24 | val configureButton = holder.findViewById(R.id.configurable_switch_button) as MaterialButton
25 | val switch = holder.findViewById(R.id.configurable_switch) as MaterialSwitch
26 | switch.isChecked = sharedPreferences!!.getBoolean(key, false)
27 | switch.setOnCheckedChangeListener { button, state ->
28 | setState(state)
29 | }
30 | configureButton.setOnClickListener { setAction() }
31 | holder.itemView.setOnClickListener { setAction() }
32 | }
33 |
34 | private fun setupPreference() {
35 | widgetLayoutResource = R.layout.preference_configurable_switch
36 | summary = context.getString(R.string.tap_to_set_long_action)
37 | }
38 |
39 | fun setAction() {
40 | val dialogBuilder = MaterialAlertDialogBuilder(context)
41 | dialogBuilder.setTitle(R.string.long_press_action)
42 | val item = NAV_LONG_ACTIONS.indexOf(getAction())
43 | dialogBuilder.setSingleChoiceItems(
44 | R.array.nav_long_actions,
45 | item
46 | ) { dialogInterface, position ->
47 | sharedPreferences!!.edit {
48 | putString("${key}_long_action", NAV_LONG_ACTIONS[position])
49 | }
50 | dialogInterface.dismiss()
51 | }
52 | dialogBuilder.show()
53 | }
54 |
55 | fun setState(state: Boolean) {
56 | persistBoolean(state)
57 | }
58 |
59 | fun getAction() = sharedPreferences!!.getString("${key}_long_action", "none")
60 | }
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/preferences/AppChooserPreference.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.preferences
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.view.LayoutInflater
6 | import android.view.View
7 | import android.view.ViewGroup
8 | import android.widget.ArrayAdapter
9 | import android.widget.ImageView
10 | import android.widget.TextView
11 | import androidx.preference.Preference
12 | import com.google.android.material.dialog.MaterialAlertDialogBuilder
13 | import cu.axel.smartdock.R
14 | import cu.axel.smartdock.models.App
15 | import cu.axel.smartdock.utils.AppUtils
16 | import cu.axel.smartdock.utils.ColorUtils
17 | import androidx.core.content.edit
18 |
19 |
20 | class AppChooserPreference(private val context: Context, attrs: AttributeSet?) : Preference(context, attrs) {
21 |
22 | override fun onAttached() {
23 | val packageName = sharedPreferences!!.getString(key, "")!!
24 | summary = if (packageName.isEmpty())
25 | context.getString(R.string.tap_to_set)
26 | else
27 | AppUtils.getPackageLabel(context, packageName)
28 | }
29 |
30 | override fun onClick() {
31 | val dialog = MaterialAlertDialogBuilder(context)
32 | dialog.setTitle(R.string.choose_app)
33 | val apps = AppUtils.getInstalledApps(context)
34 | dialog.setAdapter(AppAdapter(context, apps)) { _, position ->
35 | val app = apps[position]
36 | sharedPreferences!!.edit { putString(key, app.packageName) }
37 | summary = app.name
38 | }
39 | dialog.show()
40 | }
41 |
42 | internal class AppAdapter(private val context: Context, apps: ArrayList) : ArrayAdapter(context, R.layout.pin_entry, apps) {
43 | override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
44 | var convertView = convertView
45 | if (convertView == null) convertView = LayoutInflater.from(context).inflate(R.layout.app_chooser_entry, null)
46 | val icon = convertView!!.findViewById(R.id.app_chooser_entry_iv)
47 | val text = convertView.findViewById(R.id.app_chooser_entry_tv)
48 | val app = getItem(position)!!
49 | icon.setImageDrawable(app.icon)
50 | text.text = app.name
51 | ColorUtils.applyColor(icon, ColorUtils.getDrawableDominantColor(icon.drawable))
52 | return convertView
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_color_picker.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
16 |
17 |
23 |
24 |
30 |
31 |
32 |
39 |
40 |
43 |
44 |
45 |
46 |
47 |
52 |
53 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/app/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
35 |
36 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/notification_entry.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
20 |
21 |
26 |
27 |
36 |
37 |
44 |
45 |
46 |
47 |
54 |
55 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/preferences_main.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
12 |
16 |
20 |
24 |
28 |
32 |
36 |
40 |
44 |
48 |
49 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/fragments/SoundsPreferences.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.fragments
2 |
3 | import android.app.Activity
4 | import android.content.Intent
5 | import android.os.Bundle
6 | import androidx.preference.PreferenceFragmentCompat
7 | import cu.axel.smartdock.R
8 | import cu.axel.smartdock.preferences.FileChooserPreference
9 |
10 | class SoundsPreferences : PreferenceFragmentCompat() {
11 | private lateinit var startSoundPref: FileChooserPreference
12 | private lateinit var usbSoundPref: FileChooserPreference
13 | private lateinit var notifSoundPref: FileChooserPreference
14 | private lateinit var chargeSoundPref: FileChooserPreference
15 | private lateinit var chargeCompleteSoundPref: FileChooserPreference
16 | override fun onCreatePreferences(arg0: Bundle?, arg1: String?) {
17 | setPreferencesFromResource(R.xml.preferences_sounds, arg1)
18 | startSoundPref = findPreference("startup_sound")!!
19 | startSoundPref.setOnPreferenceClickListener {
20 | openSound(0)
21 | false
22 | }
23 | usbSoundPref = findPreference("usb_sound")!!
24 | usbSoundPref.setOnPreferenceClickListener {
25 | openSound(1)
26 | false
27 | }
28 | notifSoundPref = findPreference("notification_sound")!!
29 | notifSoundPref.setOnPreferenceClickListener {
30 | openSound(2)
31 | false
32 | }
33 | chargeSoundPref = findPreference("charge_sound")!!
34 | chargeSoundPref.setOnPreferenceClickListener {
35 | openSound(3)
36 | false
37 | }
38 | chargeCompleteSoundPref = findPreference("charge_complete_sound")!!
39 | chargeCompleteSoundPref.setOnPreferenceClickListener {
40 | openSound(4)
41 | false
42 | }
43 | }
44 |
45 | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
46 | if (resultCode == Activity.RESULT_OK) {
47 | val openUri = data!!.data
48 | requireContext().contentResolver.takePersistableUriPermission(openUri!!,
49 | Intent.FLAG_GRANT_READ_URI_PERMISSION)
50 | val file = openUri.toString()
51 | when (requestCode) {
52 | 0 -> startSoundPref.setFile(file)
53 | 1 -> usbSoundPref.setFile(file)
54 | 2 -> notifSoundPref.setFile(file)
55 | 3 -> chargeSoundPref.setFile(file)
56 | 4 -> chargeCompleteSoundPref.setFile(file)
57 | }
58 | }
59 | }
60 |
61 | private fun openSound(code: Int) {
62 | startActivityForResult(
63 | Intent(Intent.ACTION_OPEN_DOCUMENT).addCategory(Intent.CATEGORY_OPENABLE).setType("audio/*"), code)
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/db/DBHelper.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.db
2 |
3 | import android.content.ContentValues
4 | import android.content.Context
5 | import android.database.sqlite.SQLiteDatabase
6 | import android.database.sqlite.SQLiteOpenHelper
7 | import cu.axel.smartdock.db.DatabaseContract.LaunchModesTable
8 | import android.provider.BaseColumns
9 |
10 | class DBHelper(context: Context) : SQLiteOpenHelper(context, DATABASE_NAME, null, DATABASE_VERSION) {
11 | override fun onCreate(p1: SQLiteDatabase) {
12 | p1.execSQL(SQL_CREATE_MODES_ENTRIES)
13 | }
14 |
15 | override fun onUpgrade(p1: SQLiteDatabase, p2: Int, p3: Int) {}
16 | fun saveLaunchMode(app: String, mode: String) {
17 | try {
18 | val db = writableDatabase
19 | val values = ContentValues()
20 | values.put(LaunchModesTable.COLUMN_PACKAGE_NAME, app)
21 | values.put(LaunchModesTable.COLUMN_LAUNCH_MODE, mode)
22 | val selection = LaunchModesTable.COLUMN_PACKAGE_NAME + " = ?"
23 | val selectionArgs = arrayOf(app)
24 | val cursor = db.query(LaunchModesTable.TABLE_NAME, null, selection, selectionArgs, null, null, null)
25 | if (cursor != null && cursor.count > 0) {
26 | cursor.moveToFirst()
27 | db.update(LaunchModesTable.TABLE_NAME, values, selection, selectionArgs)
28 | } else {
29 | db.insert(LaunchModesTable.TABLE_NAME, null, values)
30 | }
31 | cursor!!.close()
32 | } catch (_: Exception) {
33 | }
34 | }
35 |
36 | fun getLaunchMode(app: String): String? {
37 | var mode: String? = null
38 | try {
39 | val db = readableDatabase
40 | val selection = LaunchModesTable.COLUMN_PACKAGE_NAME + " = ?"
41 | val selectionArgs = arrayOf(app)
42 | val cursor = db.query(LaunchModesTable.TABLE_NAME, null, selection, selectionArgs, null, null, null)
43 | if (cursor != null && cursor.count > 0) {
44 | cursor.moveToFirst()
45 | //TODO: recheck this
46 | val index = cursor.getColumnIndex(LaunchModesTable.COLUMN_LAUNCH_MODE)
47 | mode = cursor.getString(index)
48 | cursor.close()
49 | }
50 | } catch (_: Exception) {
51 | }
52 | return mode
53 | }
54 |
55 | companion object {
56 | private const val DATABASE_VERSION = 1
57 | private const val DATABASE_NAME = "smartdock.db"
58 | private const val SQL_CREATE_MODES_ENTRIES = ("CREATE TABLE " + LaunchModesTable.TABLE_NAME + " ("
59 | + BaseColumns._ID + " INTEGER PRIMARY KEY NOT NULL," + LaunchModesTable.COLUMN_PACKAGE_NAME
60 | + " TEXT NOT NULL," + LaunchModesTable.COLUMN_LAUNCH_MODE + " TEXT NOT NULL )")
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/xml/preferences_keyboard.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
12 |
16 |
20 |
24 |
28 |
29 |
31 |
35 |
39 |
43 |
47 |
51 |
55 |
56 |
58 |
62 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/app/src/main/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - @string/dark
5 | - @string/black
6 | - @string/transparent
7 | - @string/material_u
8 | - @string/custom
9 |
10 |
11 |
12 | - dark
13 | - black
14 | - transparent
15 | - material_u
16 | - custom
17 |
18 |
19 |
20 | - @string/circle
21 | - @string/squircle
22 | - @string/system
23 |
24 |
25 |
26 | - circle
27 | - round_rect
28 | - default
29 |
30 |
31 |
32 | - @string/standard
33 | - @string/maximized
34 | - @string/portrait
35 | - @string/fullscreen
36 |
37 |
38 | - standard
39 | - maximized
40 | - portrait
41 | - fullscreen
42 |
43 |
44 |
45 | - @string/phone
46 | - @string/tablet
47 | - @string/desktop
48 |
49 |
50 |
51 | - @string/swipe
52 | - @string/handle
53 |
54 |
55 |
56 | - swipe
57 | - handle
58 |
59 |
60 |
61 | - @string/left
62 | - @string/right
63 |
64 |
65 |
66 | - start
67 | - end
68 |
69 |
70 |
71 | - @string/none
72 | - @string/open_notifications
73 | - @string/launch_assistant
74 | - @string/lock_device
75 | - @string/toggle_split_screen
76 |
77 |
78 |
79 | - #EF5350
80 | - #B71C1C
81 | - #880E4F
82 | - #4A148C
83 | - #311B92
84 | - #1A237E
85 |
86 | - #0D47A1
87 | - #01579B
88 | - #006064
89 | - #004D40
90 | - #1B5E20
91 |
92 | - #33691E
93 | - #827717
94 | - #F57F17
95 | - #FF6F00
96 | - #E65100
97 |
98 | - #BF360C
99 | - #3E2723
100 | - #212121
101 | - #263238
102 |
103 |
104 | - #959595
105 | - #727272
106 | - #565656
107 | - #3E3E3E
108 | - #101010
109 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/preferences_app_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
12 |
17 |
22 |
26 |
31 |
32 |
33 |
35 |
41 |
46 |
47 |
52 |
53 |
58 |
59 |
60 |
63 |
67 |
71 |
72 |
74 |
77 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/app/src/main/java/cu/axel/smartdock/preferences/IconPackPreference.kt:
--------------------------------------------------------------------------------
1 | package cu.axel.smartdock.preferences
2 |
3 | import android.content.Context
4 | import android.content.DialogInterface
5 | import android.content.Intent
6 | import android.content.SharedPreferences
7 | import android.content.pm.PackageManager
8 | import android.content.pm.ResolveInfo
9 | import android.util.AttributeSet
10 | import androidx.preference.Preference
11 | import androidx.preference.PreferenceManager
12 | import com.google.android.material.dialog.MaterialAlertDialogBuilder
13 | import cu.axel.smartdock.R
14 | import cu.axel.smartdock.utils.AppUtils
15 | import androidx.core.content.edit
16 |
17 | private val LAUNCHER_INTENTS = arrayOf(
18 | "com.fede.launcher.THEME_ICONPACK",
19 | "com.anddoes.launcher.THEME",
20 | "com.teslacoilsw.launcher.THEME",
21 | "com.gau.go.launcherex.theme",
22 | "org.adw.launcher.THEMES",
23 | "org.adw.launcher.icons.ACTION_PICK_ICON",
24 | "net.oneplus.launcher.icons.ACTION_PICK_ICON"
25 | )
26 |
27 | class IconPackPreference(private val context: Context, attrs: AttributeSet?) : Preference(context, attrs) {
28 |
29 | private var sp: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
30 |
31 | /*
32 | These are all icon pack intents to date
33 | It could change in the future
34 | but by default, I don't think we even use these any more in icon packs
35 | but we support all icon packs to date (Long live Ander Web)
36 | */
37 |
38 | init {
39 | setTitle(R.string.icon_pack)
40 | val iconPack = sp.getString("icon_pack", "")!!
41 | if (iconPack.isEmpty()) {
42 | setSummary(R.string.system)
43 | } else {
44 | summary = AppUtils.getPackageLabel(context, iconPack)
45 | }
46 | }
47 |
48 | override fun onClick() {
49 | val pm: PackageManager = context.packageManager
50 |
51 | /*
52 | We manually add Smart Dock context as a default item so Smart Dock has a default item to rely on
53 | */
54 | val iconPackageList = ArrayList()
55 | val iconNameList = ArrayList()
56 | iconPackageList.add(context.packageName)
57 | iconNameList.add(context.getString(R.string.system))
58 | val launcherActivities: MutableList = ArrayList()
59 | /*
60 | Gather all the apps installed on the device
61 | filter all the icon pack packages to the list
62 | */for (i in LAUNCHER_INTENTS) {
63 | launcherActivities.addAll(
64 | pm.queryIntentActivities(
65 | Intent(i),
66 | PackageManager.GET_META_DATA
67 | )
68 | )
69 | }
70 | for (resolveInfo in launcherActivities) {
71 | iconPackageList.add(resolveInfo.activityInfo.packageName)
72 | iconNameList.add(
73 | AppUtils.getPackageLabel(
74 | context,
75 | resolveInfo.activityInfo.packageName
76 | )
77 | )
78 | }
79 | val cleanedNameList: Set = LinkedHashSet(iconNameList)
80 | val newNameList = cleanedNameList.toTypedArray()
81 | val dialog = MaterialAlertDialogBuilder(context)
82 | dialog.setTitle(R.string.icon_pack)
83 | dialog.setItems(
84 | newNameList
85 | ) { _: DialogInterface?, item: Int ->
86 | if (iconPackageList[item] == context.packageName) {
87 | sp.edit { putString("icon_pack", "") }
88 | setSummary(R.string.system)
89 | } else {
90 | val iconPack = iconPackageList[item]
91 | sp.edit { putString("icon_pack", iconPack) }
92 | summary = AppUtils.getPackageLabel(context, iconPack)
93 | }
94 | }
95 | dialog.show()
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to Smart Dock
2 |
3 | Thank you for your interest in contributing to the SmartDock project. Your contributions can help us enhance this innovative docking software. We have outlined the following guidelines to ensure a smooth and collaborative experience:
4 |
5 | ## **Submitting Contributions**
6 |
7 | To contribute to this project, please follow these steps:
8 |
9 | ### **1. Choose or Create an Issue**
10 |
11 | - Start by reviewing the existing issues to identify areas where your contributions can make a significant impact.
12 | - If you have new features, enhancements, or bug fixes in mind, you can create a new issue to propose your contributions. Please provide comprehensive details to clearly explain your ideas.
13 |
14 | ### **2. Fork the Repository**
15 |
16 | - To initiate your contribution, fork the primary repository by clicking the "Fork" button. This creates a copy of the repository in your personal GitHub account.
17 |
18 | ### **3. Clone Your Forked Repository**
19 |
20 | - Clone your forked repository to your local development environment using the following command:
21 |
22 | ```bash
23 | git clone https://github.com/your-username/smartdock.git
24 | ```
25 |
26 | ### **4. Set Up the Upstream Remote**
27 |
28 | - Keep a reference to the primary project by adding it as the upstream remote:
29 |
30 | ```bash
31 | cd smartdock
32 | git remote add upstream https://github.com/axel358/smartdock
33 | git remote -v
34 | ```
35 |
36 | ### **5. Create a New Branch**
37 |
38 | - Before you start working on your contribution, create a new branch dedicated to your specific task:
39 |
40 | ```bash
41 | git checkout -b my-contribution
42 | ```
43 |
44 | ## **Working on Your Contribution**
45 |
46 | Now that your development environment is set up and a new branch is created, you can begin working on your contribution. Please follow these guidelines:
47 |
48 | ### **6. Make Changes**
49 |
50 | - Implement the necessary changes, including code additions, enhancements, or bug fixes. Ensure that your contributions are well-structured and documented, aligning with the project's objectives.
51 |
52 | ### **7. Commit Your Changes**
53 |
54 | - Commit your changes with informative commit messages that clearly explain the purpose of your contributions:
55 |
56 | ```bash
57 | git commit -m "Add a descriptive message here"
58 | ```
59 |
60 | ### **8. Push Your Changes**
61 |
62 | - Push the committed changes to your remote repository on GitHub:
63 |
64 | ```bash
65 | git push origin my-contribution
66 | ```
67 |
68 | ### **9. Create a Pull Request**
69 |
70 | - Visit your repository on GitHub and click the "New Pull Request" button to initiate a pull request from your branch to the primary repository.
71 |
72 | ### **10. Await Review**
73 |
74 | - Your pull request will undergo review, and feedback will be provided by the project maintainers or fellow contributors. Be prepared to address any suggested changes or refinements.
75 |
76 | ## **Community Engagement**
77 |
78 | While contributing, consider engaging with the community in the following ways:
79 |
80 | ### **11. Join Discussions**
81 |
82 | - Participate in discussions related to SmartDock's features, enhancements, and bug fixes. Share your insights and expertise, and collaborate with others to achieve common goals.
83 |
84 | ### **12. Share Ideas**
85 |
86 | - If you have innovative ideas for advancing the project or improving its capabilities, such as new features or optimizations, don't hesitate to open issues to initiate productive discussions.
87 |
88 | ## **Acknowledgment**
89 |
90 | We appreciate your interest in enhancing SmartDock. Your contributions are vital to the project's development and success. If you have questions or require assistance, please feel free to contact the project maintainers.
91 |
92 | Thank you for your valuable contributions, and we look forward to collaborating with you on the SmartDock project! 🚀🔧🙌
93 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/power_menu.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
15 |
16 |
23 |
24 |
30 |
31 |
32 |
38 |
39 |
46 |
47 |
53 |
54 |
55 |
61 |
62 |
69 |
70 |
76 |
77 |
78 |
84 |
85 |
92 |
93 |
99 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #2b69e2
4 | #0456CF
5 | #FFFFFF
6 | #DAE2FF
7 | #001847
8 | #365BAD
9 | #FFFFFF
10 | #DAE2FF
11 | #001847
12 | #385BA9
13 | #FFFFFF
14 | #DAE2FF
15 | #001946
16 | #BA1A1A
17 | #FFDAD6
18 | #FFFFFF
19 | #410002
20 | #FEFBFF
21 | #1B1B1F
22 | #FEFBFF
23 | #1B1B1F
24 | #E1E2EC
25 | #44464F
26 | #757780
27 | #F2F0F4
28 | #303034
29 | #B1C5FF
30 | #000000
31 | #0456CF
32 | #C5C6D0
33 | #000000
34 | #B1C5FF
35 | #002C72
36 | #0040A0
37 | #DAE2FF
38 | #B1C5FF
39 | #002C72
40 | #404659
41 | #DAE2FF
42 | #B1C5FF
43 | #002C70
44 | #1C438F
45 | #DAE2FF
46 | #FFB4AB
47 | #93000A
48 | #690005
49 | #FFDAD6
50 | #1B1B1F
51 | #E4E2E6
52 | #1B1B1F
53 | #E4E2E6
54 | #44464F
55 | #C5C6D0
56 | #8F9099
57 | #1B1B1F
58 | #E4E2E6
59 | #0456CF
60 | #000000
61 | #B1C5FF
62 | #44464F
63 | #000000
64 | #E53935
65 | #00897B
66 | #1E88E5
67 | #DCE2FC
68 |
69 |
70 |
--------------------------------------------------------------------------------