├── .github ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── build-android-project.yml ├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTORS.md ├── LICENSE ├── Makefile ├── README.md ├── app ├── build.gradle └── src │ ├── flavorGplayPreAlpha │ ├── ic_launcher-web.png │ └── res │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ └── mipmap-xxxhdpi │ │ └── ic_launcher.png │ └── main │ ├── AndroidManifest.xml │ ├── assets │ ├── RobotoCondensed-Bold.ttf │ ├── RobotoCondensed-BoldItalic.ttf │ ├── RobotoCondensed-Italic.ttf │ ├── RobotoCondensed-Light.ttf │ ├── RobotoCondensed-LightItalic.ttf │ └── RobotoCondensed-Regular.ttf │ ├── java │ ├── com │ │ ├── benny │ │ │ └── openlauncher │ │ │ │ ├── AppObject.java │ │ │ │ ├── activity │ │ │ │ ├── AddShortcutActivity.java │ │ │ │ ├── AutoFinishActivity.java │ │ │ │ ├── ColorActivity.java │ │ │ │ ├── HideAppsActivity.java │ │ │ │ ├── HomeActivity.java │ │ │ │ ├── MinibarEditActivity.java │ │ │ │ ├── MoreInfoActivity.java │ │ │ │ ├── OnBoardActivity.java │ │ │ │ ├── SettingsActivity.java │ │ │ │ └── homeparts │ │ │ │ │ ├── HpAppDrawer.java │ │ │ │ │ ├── HpDesktopOption.java │ │ │ │ │ ├── HpDragOption.java │ │ │ │ │ ├── HpEventHandler.java │ │ │ │ │ ├── HpGestureCallback.java │ │ │ │ │ ├── HpInitSetup.java │ │ │ │ │ ├── HpItemOption.java │ │ │ │ │ └── HpSearchBar.java │ │ │ │ ├── fragment │ │ │ │ ├── HideAppsFragment.java │ │ │ │ ├── SettingsAboutFragment.java │ │ │ │ ├── SettingsAppDrawerFragment.java │ │ │ │ ├── SettingsAppearanceFragment.java │ │ │ │ ├── SettingsBaseFragment.java │ │ │ │ ├── SettingsBehaviorFragment.java │ │ │ │ ├── SettingsDesktopFragment.java │ │ │ │ ├── SettingsDockFragment.java │ │ │ │ ├── SettingsMasterFragment.java │ │ │ │ └── SettingsMiscellaneousFragment.java │ │ │ │ ├── interfaces │ │ │ │ ├── AppDeleteListener.java │ │ │ │ ├── AppUpdateListener.java │ │ │ │ ├── DialogListener.java │ │ │ │ ├── DropTargetListener.java │ │ │ │ └── ItemHistory.java │ │ │ │ ├── manager │ │ │ │ └── Setup.java │ │ │ │ ├── model │ │ │ │ ├── App.java │ │ │ │ └── Item.java │ │ │ │ ├── notifications │ │ │ │ └── NotificationListener.java │ │ │ │ ├── receivers │ │ │ │ ├── AppUpdateReceiver.java │ │ │ │ ├── DeviceAdminReceiver.java │ │ │ │ └── ShortcutReceiver.java │ │ │ │ ├── util │ │ │ │ ├── AppManager.java │ │ │ │ ├── AppSettings.java │ │ │ │ ├── BackupHelper.java │ │ │ │ ├── DatabaseHelper.java │ │ │ │ ├── Definitions.java │ │ │ │ ├── DragAction.java │ │ │ │ ├── DragHandler.java │ │ │ │ ├── IconPackHelper.java │ │ │ │ ├── LauncherAction.java │ │ │ │ └── Tool.java │ │ │ │ ├── viewutil │ │ │ │ ├── AbstractPopupIconLabelItem.java │ │ │ │ ├── CircleDrawable.java │ │ │ │ ├── DesktopCallback.java │ │ │ │ ├── DesktopGestureListener.java │ │ │ │ ├── DialogHelper.java │ │ │ │ ├── DrawerAppItem.java │ │ │ │ ├── GroupDrawable.java │ │ │ │ ├── IconLabelItem.java │ │ │ │ ├── ItemViewFactory.java │ │ │ │ ├── MinibarAdapter.java │ │ │ │ ├── PopupDynamicIconLabelItem.java │ │ │ │ ├── PopupIconLabelItem.java │ │ │ │ └── WidgetHost.java │ │ │ │ └── widget │ │ │ │ ├── AppDrawerController.java │ │ │ │ ├── AppDrawerGrid.java │ │ │ │ ├── AppDrawerPage.java │ │ │ │ ├── AppItemView.java │ │ │ │ ├── CellContainer.java │ │ │ │ ├── ColorPreferenceCategory.java │ │ │ │ ├── Desktop.java │ │ │ │ ├── DesktopOptionView.java │ │ │ │ ├── Dock.java │ │ │ │ ├── GroupPopupView.java │ │ │ │ ├── ItemOptionView.java │ │ │ │ ├── MinibarView.java │ │ │ │ ├── NavigationView.java │ │ │ │ ├── PagerIndicator.java │ │ │ │ ├── SearchBar.java │ │ │ │ ├── StatusView.java │ │ │ │ ├── WidgetContainer.java │ │ │ │ └── WidgetView.java │ │ └── flask │ │ │ └── colorpicker │ │ │ ├── ColorCircle.java │ │ │ ├── ColorCircleDrawable.java │ │ │ ├── ColorPickerPreference.java │ │ │ ├── ColorPickerView.java │ │ │ ├── OnColorChangedListener.java │ │ │ ├── OnColorSelectedListener.java │ │ │ ├── Utils.java │ │ │ ├── builder │ │ │ ├── ColorPickerClickListener.java │ │ │ ├── ColorPickerDialogBuilder.java │ │ │ ├── ColorWheelRendererBuilder.java │ │ │ └── PaintBuilder.java │ │ │ ├── renderer │ │ │ ├── AbsColorWheelRenderer.java │ │ │ ├── ColorWheelRenderOption.java │ │ │ ├── ColorWheelRenderer.java │ │ │ ├── FlowerColorWheelRenderer.java │ │ │ └── SimpleColorWheelRenderer.java │ │ │ └── slider │ │ │ ├── AbsCustomSlider.java │ │ │ ├── AlphaSlider.java │ │ │ ├── LightnessSlider.java │ │ │ └── OnValueChangedListener.java │ └── net │ │ └── gsantner │ │ └── opoc │ │ ├── format │ │ └── markdown │ │ │ └── SimpleMarkdownParser.java │ │ ├── preference │ │ ├── GsPreferenceFragmentCompat.java │ │ ├── LanguagePreferenceCompat.java │ │ ├── PropertyBackend.java │ │ └── SharedPreferencesPropertyBackend.java │ │ └── util │ │ ├── ActivityUtils.java │ │ ├── Callback.java │ │ ├── ContextUtils.java │ │ ├── FileUtils.java │ │ ├── NetworkUtils.java │ │ ├── PermissionChecker.java │ │ └── ShareUtil.java │ └── res │ ├── drawable-nodpi │ ├── intro_2.png │ ├── intro_3.png │ └── intro_4.png │ ├── drawable │ ├── ic_android.xml │ ├── ic_apps.xml │ ├── ic_arrow_back_white.xml │ ├── ic_behavior.xml │ ├── ic_bug.xml │ ├── ic_camera_.xml │ ├── ic_check_dark.xml │ ├── ic_check_white.xml │ ├── ic_clear.xml │ ├── ic_close.xml │ ├── ic_code.xml │ ├── ic_copyright.xml │ ├── ic_dashboard.xml │ ├── ic_delete.xml │ ├── ic_desktop.xml │ ├── ic_dock.xml │ ├── ic_edit.xml │ ├── ic_expand.xml │ ├── ic_favorite.xml │ ├── ic_group.xml │ ├── ic_hide_apps.xml │ ├── ic_info.xml │ ├── ic_launch.xml │ ├── ic_lock.xml │ ├── ic_lock_open.xml │ ├── ic_minibar.xml │ ├── ic_network.xml │ ├── ic_notifications.xml │ ├── ic_palette.xml │ ├── ic_person.xml │ ├── ic_photo.xml │ ├── ic_resize.xml │ ├── ic_search.xml │ ├── ic_settings.xml │ ├── ic_star.xml │ ├── ic_star_border.xml │ ├── ic_thumb_up.xml │ ├── ic_translate.xml │ ├── ic_view_grid_white.xml │ ├── ic_view_list_white.xml │ ├── ic_visibility.xml │ ├── ic_volume.xml │ ├── item_drawer.xml │ ├── new_page.xml │ ├── ol_loading_1.xml │ ├── ol_loading_2.xml │ ├── ol_loading_3.xml │ └── scale_widget.xml │ ├── layout │ ├── activity_hide_apps.xml │ ├── activity_home.xml │ ├── activity_minibar_edit.xml │ ├── activity_more.xml │ ├── activity_settings.xml │ ├── color_edit.xml │ ├── color_preview.xml │ ├── color_selector.xml │ ├── color_widget.xml │ ├── item_app.xml │ ├── item_edit_minibar.xml │ ├── item_hide_apps.xml │ ├── item_icon_label.xml │ ├── item_minibar.xml │ ├── item_popup_icon_label.xml │ ├── toolbar.xml │ ├── view_app_drawer_grid.xml │ ├── view_app_drawer_page.xml │ ├── view_app_drawer_page_inner.xml │ ├── view_drag_option.xml │ ├── view_drawer_indicator.xml │ ├── view_group_popup.xml │ ├── view_hide_apps.xml │ ├── view_home.xml │ ├── view_intro.xml │ ├── view_search_clock.xml │ └── view_widget_container.xml │ ├── mipmap-hdpi │ └── ic_launcher.png │ ├── mipmap-mdpi │ └── ic_launcher.png │ ├── mipmap-xhdpi │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ └── ic_launcher.png │ ├── mipmap-xxxhdpi │ └── ic_launcher.png │ ├── raw │ ├── licenses.md │ └── project.md │ ├── values-ar │ └── strings.xml │ ├── values-ca │ └── strings.xml │ ├── values-cs │ └── strings.xml │ ├── values-de │ └── strings.xml │ ├── values-en-rAU │ └── strings.xml │ ├── values-eo │ └── strings.xml │ ├── values-es │ └── strings.xml │ ├── values-fr │ └── strings.xml │ ├── values-hr │ └── strings.xml │ ├── values-hu │ └── strings.xml │ ├── values-it │ └── strings.xml │ ├── values-ja │ └── strings.xml │ ├── values-kab │ └── strings.xml │ ├── values-nb-rNO │ └── strings.xml │ ├── values-nl │ └── strings.xml │ ├── values-pl │ └── strings.xml │ ├── values-pt-rBR │ └── strings.xml │ ├── values-pt-rPT │ └── strings.xml │ ├── values-ru │ └── strings.xml │ ├── values-sc │ └── strings.xml │ ├── values-sk │ └── strings.xml │ ├── values-sr │ └── strings.xml │ ├── values-sw360dp-v13 │ └── values-preference.xml │ ├── values-zh-rCN │ └── strings.xml │ ├── values │ ├── arrays.xml │ ├── color_attrs.xml │ ├── color_dimens.xml │ ├── color_styles.xml │ ├── colors.xml │ ├── dimens.xml │ ├── ids.xml │ ├── strings.xml │ ├── strings_not_translatable.xml │ └── styles.xml │ └── xml │ ├── device_admin.xml │ ├── file_paths.xml │ ├── preferences_about.xml │ ├── preferences_advanced.xml │ ├── preferences_app_drawer.xml │ ├── preferences_appearance.xml │ ├── preferences_behavior.xml │ ├── preferences_desktop.xml │ ├── preferences_dock.xml │ └── preferences_master.xml ├── assets ├── featureGraphic.svg ├── icon_all.svg ├── icon_nightly.png ├── icon_stable.png ├── icon_test.png └── screenshots.png ├── build.gradle ├── fastlane └── metadata │ └── android │ ├── de │ └── short_description.txt │ └── en-US │ ├── changelogs │ ├── 1.txt │ ├── 100.txt │ ├── 36.txt │ ├── 37.txt │ ├── 38.txt │ ├── 39.txt │ ├── 40.txt │ └── 41.txt │ ├── full_description.txt │ ├── images │ ├── featureGraphic.png │ ├── icon.png │ └── phoneScreenshots │ │ ├── 01.jpg │ │ ├── 02.jpg │ │ ├── 03.jpg │ │ ├── 04.jpg │ │ ├── 05.jpg │ │ └── 06.jpg │ └── short_description.txt ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | #### General Information 2 | 3 | * **OpenLauncher Version:** 1.0? 4 | * **Android Version:** 1.0? 5 | * **Custom ROM:** None? 6 | * **Install Source:** F-Droid? 7 | 8 | #### Description 9 | 10 | 11 | #### Log 12 | 13 | This is only needed for crashes or other issues you notice in your system logs from OpenLauncher. 14 | 15 | 20 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 21 | -------------------------------------------------------------------------------- /.github/workflows/build-android-project.yml: -------------------------------------------------------------------------------- 1 | ############################################################################################################################## 2 | # # Cleanup: 3 | #const sleep = ms => () => new Promise((resolve, reject) => window.setTimeout(resolve, ms)); 4 | #Promise.resolve() 5 | #.then(() => { document.getElementsByClassName("details-overlay details-reset position-relative d-inline-block ")[3].children[0].click(); }) 6 | #.then(sleep(500)) 7 | #.then(() => { document.getElementsByClassName("dropdown-item btn-link menu-item-danger")[0].click(); }) 8 | #.then(sleep(1000)) 9 | #.then(() => { document.getElementsByClassName("btn btn-block btn-danger")[0].click();}); 10 | # 11 | # while [ 1 ] ; do sleep 4; xdotool key Up; sleep 0.1; xdotool key Return; done 12 | ############################################################################################################################## 13 | 14 | name: "CI" 15 | 16 | on: [push, pull_request] 17 | 18 | jobs: 19 | build: 20 | if: "!contains(github.event.head_commit.message, 'ci skip') && (!contains(github.event_name, 'pull_request') || (contains(github.event_name, 'pull_request') && github.event.pull_request.head.repo.full_name != github.repository))" 21 | runs-on: ubuntu-latest 22 | steps: 23 | 24 | - name: "Checkout: Code" 25 | uses: actions/checkout@v2 26 | 27 | 28 | - name: "Checkout: Code (PR)" 29 | uses: actions/checkout@v2 30 | if: "contains(github.event_name, 'pull_request')" 31 | with: 32 | ref: ${{github.event.pull_request.head.ref}} 33 | repository: ${{github.event.pull_request.head.repo.full_name}} 34 | 35 | - name: "Setup: Java" 36 | uses: actions/setup-java@v1 37 | with: 38 | java-version: 1.8 39 | 40 | - name: "Cache: Gradle" 41 | uses: actions/cache@v2 42 | with: 43 | path: | 44 | ~/.gradle 45 | .gradle 46 | key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('gradle/wrapper/gradle-wrapper.*') }} 47 | 48 | - name: "Build: Project with make" 49 | run: make clean all 50 | 51 | - name: "Build: List dist files" 52 | if: always() 53 | run: find dist -type f -maxdepth 2 54 | 55 | - name: "Artifacts: All" 56 | if: always() 57 | uses: actions/upload-artifact@v2.2.1 58 | with: 59 | name: "all" 60 | path: dist 61 | retention-days: 5 62 | 63 | - name: "Artifacts: Android APK" 64 | uses: actions/upload-artifact@v2.2.1 65 | with: 66 | name: "android-apk" 67 | path: | 68 | dist/*.apk 69 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | /.vscode 3 | .project 4 | 5 | # Common 6 | *~* 7 | tmp/ 8 | *.tmp 9 | *.bak 10 | *.log 11 | gradle/ 12 | gradlew 13 | gradlew.bat 14 | 15 | # IntelliJ 16 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio 17 | *.iml 18 | /out/ 19 | 20 | .idea/ 21 | # if you remove the above rule, at least ignore the following: 22 | ## User-specific stuff: 23 | # .idea/workspace.xml 24 | # .idea/tasks.xml 25 | # .idea/dictionaries 26 | ## Sensitive or high-churn files: 27 | # .idea/dataSources.ids 28 | # .idea/dataSources.xml 29 | # .idea/sqlDataSources.xml 30 | # .idea/dynamic.xml 31 | # .idea/uiDesigner.xml 32 | 33 | # Gradle: 34 | # .idea/gradle.xml 35 | # .idea/libraries 36 | 37 | ## File-based project format: 38 | *.ipr 39 | *.iws 40 | 41 | ### Gradle ### 42 | .gradle 43 | build/ 44 | gradle-app.setting 45 | 46 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 47 | !gradle-wrapper.jar 48 | 49 | # Eclipse 50 | #.project 51 | *.pydevproject 52 | .metadata 53 | *.swp 54 | *~.nib 55 | .settings/ 56 | .loadpath 57 | .externalToolBuilders/ 58 | *.launch 59 | .cproject 60 | .classpath 61 | .factorypath 62 | .buildpath 63 | .target 64 | .texlipse 65 | 66 | # Java 67 | *.class 68 | .mtj.tmp/ 69 | *.jar 70 | *.war 71 | *.ear 72 | hs_err_pid* 73 | 74 | # Android 75 | # Built application files 76 | *.apk 77 | *.ap_ 78 | 79 | # Files for the Dalvik VM 80 | *.dex 81 | 82 | # Generated files 83 | bin/ 84 | gen/ 85 | 86 | # Local configuration file (sdk path, etc) 87 | local.properties 88 | 89 | # Proguard 90 | proguard/ 91 | 92 | # Android Studio Stuff 93 | .navigation/ 94 | gen-external-apklibs 95 | !gradle/wrapper/gradle-wrapper.jar 96 | 97 | app/src/main/res/raw/changelog.md 98 | app/src/main/res/raw/contributors.md 99 | app/src/main/res/raw/readme.md 100 | app/src/main/res/raw/license 101 | app-flavorDefault-debug/ 102 | 103 | .directory 104 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ### v1.0.0 2 | * Please see either of the links for changes in the v1.0.0 version: 3 | * https://github.com/OpenLauncherTeam/openlauncher/compare/v0.7.4...v1.0.0 4 | * https://github.com/OpenLauncherTeam/openlauncher/milestone/2?closed=1 5 | * https://github.com/OpenLauncherTeam/openlauncher/commits/master 6 | 7 | ### v0.5.1 8 | * fix incorrect label clipping 9 | * improve free space calculation for widgets 10 | * slight changes to settings page 11 | * fix crash related to group items 12 | * maximum grid size set to twenty 13 | * labels can be edited from the drag menu 14 | 15 | ### v0.5.0 16 | * Settings have been redesigned and will be reset 17 | * Add ability launch app with gesture 18 | * Custom search bar layout without requiring google services 19 | * Option to lock the desktop from changes 20 | * Lots of bug fixes 21 | * Layout fixes 22 | 23 | ### v0.4.0 24 | * Desktop is now saved in database and will be reset 25 | * Move launcheranim and smoothviewpager to app 26 | * Lots of bug fixes 27 | 28 | ### v0.3.1 29 | * Update build scheme 30 | * Add nightly icons 31 | * Add CircleCI 32 | * Update library strings 33 | * Optimize icons 34 | * Refactor activities 35 | * Add minibar edit fragment 36 | * Using ButterKnife in the Home activity, using CustomOnCrash.. lib to catch any error. #36 (quick fix) 37 | * Remove unused resources, extra translations 38 | * Add settings button in desktop preview (when long pressing the desktop) 39 | * Add a switch to disable the minibar 40 | * Move backup dialog to dialog utils and rename backup folder 41 | * Refactor project to use default android gradle project layout 42 | -------------------------------------------------------------------------------- /CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | 19 | * **[Aabaker](https://github.com/aabaker)**
~° Code contributions 20 | * **[TeamBrainStorm](https://github.com/TeamBrainStorm)**
~° Very supportive when the project started 21 | * **[GauklerFaun](https://github.com/scoute-dich)**
~° German translation 22 | * **[Naofum](https://github.com/naofum)**
~° Japanese translation 23 | * **[FranzMari](https://github.com/FranzMari)**
~° Italian translation 24 | * **[MFlisar](https://github.com/MFlisar)**
~° Extraction of core 25 | * **[saechimdaeki](https://github.com/saechimdaeki)**
~° Code contributions 26 | * **[P'tit g](https://github.com/Ptitg)**
~° Code contributions 27 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # License of Makefile: Public Domain / CC0 2 | .PHONY: $(shell sed -n -e '/^$$/ { n ; /^[^ .\#][^ ]*:/ { s/:.*$$// ; p ; } ; }' $(MAKEFILE_LIST)) 3 | .NOTPARALLEL: clean 4 | .DEFAULT_GOAL := all 5 | 6 | env-%: 7 | @: $(if ${${*}},,$(error Environment variable $* not set)) 8 | #################################################################################### 9 | 10 | DIST_DIR = dist 11 | MOVE = mv 12 | 13 | all: $(DIST_DIR) lint test build aapt_dump_badging 14 | 15 | #################################################################################### 16 | 17 | $(DIST_DIR): 18 | mkdir -p ${DIST_DIR} 19 | 20 | ANDROID_BUILD_TOOLS := $(shell test -n "$ANDROID_SDK_ROOT" && find "${ANDROID_SDK_ROOT}/build-tools" -iname "aapt" | sort -r | head -n1 | xargs dirname) 21 | 22 | .NOTPARALLEL: gradle gradle-analyze-log 23 | gradle: env-ANDROID_SDK_ROOT 24 | mkdir -p $(DIST_DIR)/log/ 25 | chmod +x gradlew 26 | ./gradlew --no-daemon --parallel --stacktrace $A 2>&1 | tee "$(DIST_DIR)/log/gradle.log" 27 | @echo "-----------------------------------------------------------------------------------" 28 | 29 | gradle-analyze-log: 30 | mv "$(DIST_DIR)/log/gradle.log" "$(DIST_DIR)/log/gradle$A.log" 31 | cat "$(DIST_DIR)/log/gradle$A.log" | grep "BUILD " | tail -n1 | grep -q "BUILD SUCCESSFUL in" 32 | 33 | adb: env-ANDROID_SDK_ROOT 34 | "${ANDROID_SDK_ROOT}/platform-tools/adb" $A 2>&1 | tee "$(DIST_DIR)/log/adb$L.log" 35 | 36 | aapt: env-ANDROID_SDK_ROOT 37 | "${ANDROID_BUILD_TOOLS}/aapt" $A 2>&1 | grep -v 'application-label-' | tee "$(DIST_DIR)/log/aapt$L.log" 38 | 39 | build: 40 | rm -f $(DIST_DIR)/*.apk 41 | $(MAKE) A="clean assembleFlavorAtest -x lint" gradle 42 | find app -type f -newermt '-100 seconds' -iname '*.apk' -not -iname '*unsigned.apk' | xargs cp -R -t $(DIST_DIR)/ 43 | $(MAKE) A="-build" gradle-analyze-log 44 | 45 | lint: 46 | rm -Rf $(DIST_DIR)/lint 47 | mkdir -p $(DIST_DIR)/lint/ 48 | $(MAKE) A="lintFlavorDefaultDebug" gradle 49 | find app -type f -iname 'lint-results-*' | xargs cp -R -t $(DIST_DIR)/lint 50 | $(MAKE) A="-lint" gradle-analyze-log 51 | 52 | test: 53 | rm -Rf $(DIST_DIR)/tests 54 | $(MAKE) A="testFlavorDefaultDebugUnitTest -x lint" gradle 55 | mkdir -p app/build/test-results/testFlavorDefaultDebugUnitTest && echo 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHRlc3RzdWl0ZSBuYW1lPSJkdW1teSIgdGVzdHM9IjEiIHNraXBwZWQ9IjAiIGZhaWx1cmVzPSIwIiBlcnJvcnM9IjAiIHRpbWVzdGFtcD0iMjAyMC0xMi0wOFQwMDowMDowMCIgaG9zdG5hbWU9ImxvY2FsaG9zdCIgdGltZT0iMC4wMSI+CiAgPHByb3BlcnRpZXMvPgogIDx0ZXN0Y2FzZSBuYW1lPSJkdW1teSIgY2xhc3NuYW1lPSJkdW1teSIgdGltZT0iMC4wMSIvPgogIDxzeXN0ZW0tb3V0PjwhW0NEQVRBW11dPjwvc3lzdGVtLW91dD4KICA8c3lzdGVtLWVycj48IVtDREFUQVtdXT48L3N5c3RlbS1lcnI+CjwvdGVzdHN1aXRlPgo=' | base64 -d > 'app/build/test-results/testFlavorDefaultDebugUnitTest/TEST-dummy.xml' 56 | find app -type d -iname 'testFlavorDefaultDebugUnitTest' | xargs cp -R -t $(DIST_DIR)/ 57 | mv ${DIST_DIR}/testFlavorDefaultDebugUnitTest $(DIST_DIR)/tests 58 | $(MAKE) A="-test" gradle-analyze-log 59 | 60 | clean: 61 | $(MAKE) A="clean" gradle 62 | rm -Rf $(DIST_DIR) app/build app/flavor* 63 | $(MAKE) $(DIST_DIR) 64 | 65 | install: 66 | $(MAKE) A="install -r $(DIST_DIR)/*.apk" L="install" adb 67 | 68 | aapt_dump_badging: 69 | $(MAKE) A="dump badging $(DIST_DIR)/*.apk" aapt 70 | @echo "-----------------------------------------------------------------------------------" 71 | -------------------------------------------------------------------------------- /app/src/flavorGplayPreAlpha/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/app/src/flavorGplayPreAlpha/ic_launcher-web.png -------------------------------------------------------------------------------- /app/src/flavorGplayPreAlpha/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/app/src/flavorGplayPreAlpha/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/flavorGplayPreAlpha/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/app/src/flavorGplayPreAlpha/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/flavorGplayPreAlpha/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/app/src/flavorGplayPreAlpha/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/flavorGplayPreAlpha/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/app/src/flavorGplayPreAlpha/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/flavorGplayPreAlpha/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/app/src/flavorGplayPreAlpha/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/assets/RobotoCondensed-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/app/src/main/assets/RobotoCondensed-Bold.ttf -------------------------------------------------------------------------------- /app/src/main/assets/RobotoCondensed-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/app/src/main/assets/RobotoCondensed-BoldItalic.ttf -------------------------------------------------------------------------------- /app/src/main/assets/RobotoCondensed-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/app/src/main/assets/RobotoCondensed-Italic.ttf -------------------------------------------------------------------------------- /app/src/main/assets/RobotoCondensed-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/app/src/main/assets/RobotoCondensed-Light.ttf -------------------------------------------------------------------------------- /app/src/main/assets/RobotoCondensed-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/app/src/main/assets/RobotoCondensed-LightItalic.ttf -------------------------------------------------------------------------------- /app/src/main/assets/RobotoCondensed-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/app/src/main/assets/RobotoCondensed-Regular.ttf -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/AppObject.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher; 2 | 3 | import android.app.Application; 4 | 5 | public class AppObject extends Application { 6 | private static AppObject _instance; 7 | 8 | public static AppObject get() { 9 | return _instance; 10 | } 11 | 12 | @Override 13 | public void onCreate() { 14 | super.onCreate(); 15 | _instance = this; 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/activity/AddShortcutActivity.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.activity; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.pm.LauncherApps; 7 | import android.content.pm.ShortcutInfo; 8 | import android.graphics.Point; 9 | import android.graphics.drawable.Drawable; 10 | import android.os.Build; 11 | import android.os.Bundle; 12 | import android.util.Log; 13 | 14 | import com.benny.openlauncher.AppObject; 15 | import com.benny.openlauncher.R; 16 | import com.benny.openlauncher.model.Item; 17 | import com.benny.openlauncher.util.Definitions; 18 | import com.benny.openlauncher.util.Tool; 19 | 20 | public class AddShortcutActivity extends Activity { 21 | 22 | @Override 23 | protected void onCreate(Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | if (getIntent() != null && getIntent().getAction().equalsIgnoreCase(LauncherApps.ACTION_CONFIRM_PIN_SHORTCUT)) { 26 | LauncherApps launcherApps = (LauncherApps) getSystemService(Context.LAUNCHER_APPS_SERVICE); 27 | LauncherApps.PinItemRequest request = launcherApps.getPinItemRequest(getIntent()); 28 | if (request == null) { 29 | finish(); 30 | return; 31 | } 32 | 33 | if (request.getRequestType() == LauncherApps.PinItemRequest.REQUEST_TYPE_SHORTCUT) { 34 | 35 | ShortcutInfo info = request.getShortcutInfo(); 36 | String shortcutLabel = info.getShortLabel().toString(); 37 | Intent shortcutIntent = new Intent(Intent.ACTION_MAIN) 38 | .setComponent(info.getActivity()) 39 | .setPackage(info.getPackage()) 40 | .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED) 41 | .putExtra("shortcut_id", info.getId()); 42 | 43 | Context context = AppObject.get().getApplicationContext(); 44 | Drawable shortcutIcon = launcherApps.getShortcutIconDrawable(info, context.getResources().getDisplayMetrics().densityDpi); 45 | 46 | Item item = Item.newShortcutItem(shortcutIntent, shortcutIcon, shortcutLabel); 47 | Point preferredPos = HomeActivity.Companion.getLauncher().getDesktop().getPages().get(HomeActivity.Companion.getLauncher().getDesktop().getCurrentItem()).findFreeSpace(); 48 | 49 | if (preferredPos == null) { 50 | Tool.toast(HomeActivity.Companion.getLauncher(), R.string.toast_not_enough_space); 51 | } else { 52 | item.setX(preferredPos.x); 53 | item.setY(preferredPos.y); 54 | HomeActivity._db.saveItem(item, HomeActivity.Companion.getLauncher().getDesktop().getCurrentItem(), Definitions.ItemPosition.Desktop); 55 | HomeActivity.Companion.getLauncher().getDesktop().addItemToPage(item, HomeActivity.Companion.getLauncher().getDesktop().getCurrentItem()); 56 | Log.d(this.getClass().toString(), "shortcut installed"); 57 | } 58 | 59 | request.accept(); 60 | finish(); 61 | } 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/activity/AutoFinishActivity.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.activity; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import android.support.annotation.Nullable; 8 | 9 | public class AutoFinishActivity extends Activity { 10 | @Override 11 | protected void onCreate(@Nullable Bundle savedInstanceState) { 12 | super.onCreate(savedInstanceState); 13 | finish(); 14 | } 15 | 16 | public static void start(Context context) { 17 | context.startActivity(new Intent(context, AutoFinishActivity.class)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/activity/ColorActivity.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.activity; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Color; 5 | import android.os.Build; 6 | import android.os.Bundle; 7 | import android.support.v7.app.AppCompatActivity; 8 | 9 | import com.benny.openlauncher.R; 10 | import com.benny.openlauncher.util.AppSettings; 11 | 12 | public abstract class ColorActivity extends AppCompatActivity { 13 | 14 | protected AppSettings _appSettings; 15 | private String _currentTheme; 16 | 17 | @Override 18 | protected void onCreate(Bundle savedInstanceState) { 19 | _appSettings = AppSettings.get(); 20 | _currentTheme = _appSettings.getTheme(); 21 | 22 | if (_appSettings.getTheme().equals("0")) { 23 | setTheme(R.style.NormalActivity_Light); 24 | } else if (_appSettings.getTheme().equals("1")) { 25 | setTheme(R.style.NormalActivity_Dark); 26 | } else { 27 | setTheme(R.style.NormalActivity_Black); 28 | } 29 | 30 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 31 | getWindow().setStatusBarColor(dark(_appSettings.getPrimaryColor(), 0.8)); 32 | getWindow().setNavigationBarColor(_appSettings.getPrimaryColor()); 33 | } 34 | 35 | super.onCreate(savedInstanceState); 36 | } 37 | 38 | @Override 39 | protected void onResume() { 40 | super.onResume(); 41 | if (!_appSettings.getTheme().equals(_currentTheme)) { 42 | restart(); 43 | } 44 | } 45 | 46 | protected void restart() { 47 | Intent intent = new Intent(this, getClass()); 48 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); 49 | overridePendingTransition(0, 0); 50 | startActivity(intent); 51 | } 52 | 53 | public int dark(int color, double factor) { 54 | int a = Color.alpha(color); 55 | int r = Color.red(color); 56 | int g = Color.green(color); 57 | int b = Color.blue(color); 58 | return Color.argb(a, Math.max((int) (r * factor), 0), Math.max((int) (g * factor), 0), Math.max((int) (b * factor), 0)); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/activity/HideAppsActivity.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.activity; 2 | 3 | import android.os.Build; 4 | import android.os.Bundle; 5 | import android.support.v4.app.Fragment; 6 | import android.support.v4.app.FragmentManager; 7 | import android.support.v4.app.FragmentPagerAdapter; 8 | import android.support.v4.view.ViewPager; 9 | import android.support.v7.widget.Toolbar; 10 | import android.view.MenuItem; 11 | import android.view.WindowManager; 12 | 13 | import com.benny.openlauncher.R; 14 | import com.benny.openlauncher.fragment.HideAppsFragment; 15 | import com.benny.openlauncher.util.AppManager; 16 | 17 | import java.util.ArrayList; 18 | 19 | public class HideAppsActivity extends ColorActivity { 20 | 21 | @Override 22 | protected void onCreate(Bundle savedInstanceState) { 23 | super.onCreate(savedInstanceState); 24 | setContentView(R.layout.activity_hide_apps); 25 | 26 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 27 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); 28 | getWindow().setStatusBarColor(getResources().getColor(R.color.colorPrimaryDark)); 29 | } 30 | 31 | ViewPager viewPager = findViewById(R.id.viewpager); 32 | setupViewPager(viewPager); 33 | 34 | Toolbar toolbar = findViewById(R.id.toolbar); 35 | toolbar.setTitle(getString(R.string.pref_title__hide_apps)); 36 | setSupportActionBar(toolbar); 37 | 38 | getSupportActionBar().setDisplayHomeAsUpEnabled(true); 39 | getSupportActionBar().setDisplayShowHomeEnabled(true); 40 | } 41 | 42 | @Override 43 | protected void onDestroy() { 44 | AppManager.getInstance(this)._recreateAfterGettingApps = true; 45 | AppManager.getInstance(this).init(); 46 | super.onDestroy(); 47 | } 48 | 49 | private void setupViewPager(ViewPager viewPager) { 50 | ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager()); 51 | adapter.addFragment(new HideAppsFragment(), "Skip"); 52 | viewPager.setAdapter(adapter); 53 | } 54 | 55 | @Override 56 | public boolean onOptionsItemSelected(MenuItem item) { 57 | switch (item.getItemId()) { 58 | case android.R.id.home: { 59 | onBackPressed(); 60 | break; 61 | } 62 | } 63 | return super.onOptionsItemSelected(item); 64 | } 65 | 66 | private static class ViewPagerAdapter extends FragmentPagerAdapter { 67 | private ArrayList mFragmentList = new ArrayList<>(); 68 | private ArrayList mFragmentTitleList = new ArrayList<>(); 69 | 70 | ViewPagerAdapter(FragmentManager fm) { 71 | super(fm); 72 | } 73 | 74 | @Override 75 | public Fragment getItem(int position) { 76 | return mFragmentList.get(position); 77 | } 78 | 79 | @Override 80 | public int getCount() { 81 | return mFragmentTitleList.size(); 82 | } 83 | 84 | @Override 85 | public CharSequence getPageTitle(int position) { 86 | return mFragmentTitleList.get(position); 87 | } 88 | 89 | public void addFragment(Fragment fragment, String title) { 90 | mFragmentList.add(fragment); 91 | mFragmentTitleList.add(title); 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/activity/MoreInfoActivity.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.activity; 2 | 3 | import android.os.Bundle; 4 | import android.support.v4.app.FragmentTransaction; 5 | import android.support.v7.widget.Toolbar; 6 | 7 | import com.benny.openlauncher.R; 8 | import com.benny.openlauncher.fragment.SettingsAboutFragment; 9 | 10 | public class MoreInfoActivity extends ColorActivity { 11 | @Override 12 | protected void onCreate(Bundle savedInstanceState) { 13 | super.onCreate(savedInstanceState); 14 | setContentView(R.layout.activity_more); 15 | 16 | Toolbar toolbar = findViewById(R.id.toolbar); 17 | setSupportActionBar(toolbar); 18 | toolbar.setBackgroundColor(_appSettings.getPrimaryColor()); 19 | 20 | getSupportActionBar().setDisplayHomeAsUpEnabled(true); 21 | 22 | FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); 23 | SettingsAboutFragment settingsAboutFragment = SettingsAboutFragment.newInstance(); 24 | transaction.replace(R.id.fragment_holder, settingsAboutFragment, SettingsAboutFragment.TAG).commit(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/activity/homeparts/HpAppDrawer.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.activity.homeparts; 2 | 3 | import com.benny.openlauncher.activity.HomeActivity; 4 | import com.benny.openlauncher.manager.Setup; 5 | import com.benny.openlauncher.util.Tool; 6 | import com.benny.openlauncher.widget.AppDrawerController; 7 | import com.benny.openlauncher.widget.PagerIndicator; 8 | 9 | import net.gsantner.opoc.util.Callback; 10 | 11 | public class HpAppDrawer implements Callback.a2 { 12 | private HomeActivity _homeActivity; 13 | private PagerIndicator _appDrawerIndicator; 14 | 15 | public HpAppDrawer(HomeActivity homeActivity, PagerIndicator appDrawerIndicator) { 16 | _homeActivity = homeActivity; 17 | _appDrawerIndicator = appDrawerIndicator; 18 | } 19 | 20 | public void initAppDrawer(AppDrawerController appDrawerController) { 21 | appDrawerController.setCallBack(this); 22 | } 23 | 24 | @Override 25 | public void callback(Boolean openingOrClosing, Boolean startOrEnd) { 26 | if (openingOrClosing) { 27 | if (startOrEnd) { 28 | _homeActivity.getAppDrawerController().postDelayed(new Runnable() { 29 | @Override 30 | public void run() { 31 | Tool.visibleViews(200, _appDrawerIndicator); 32 | Tool.invisibleViews(200, _homeActivity.getDesktop()); 33 | _homeActivity.updateDesktopIndicator(false); 34 | _homeActivity.updateDock(false); 35 | _homeActivity.updateSearchBar(false); 36 | } 37 | }, 100); 38 | } 39 | } else { 40 | if (startOrEnd) { 41 | Tool.invisibleViews(200, _appDrawerIndicator); 42 | Tool.visibleViews(200, _homeActivity.getDesktop()); 43 | _homeActivity.updateDesktopIndicator(true); 44 | _homeActivity.updateDock(true); 45 | _homeActivity.updateSearchBar(true); 46 | } else { 47 | if (!Setup.appSettings().getDrawerRememberPosition()) { 48 | _homeActivity.getAppDrawerController().reset(); 49 | } 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/activity/homeparts/HpEventHandler.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.activity.homeparts; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | 6 | import com.afollestad.materialdialogs.MaterialDialog; 7 | import com.benny.openlauncher.interfaces.DialogListener; 8 | import com.benny.openlauncher.manager.Setup; 9 | import com.benny.openlauncher.model.Item; 10 | import com.benny.openlauncher.util.Definitions; 11 | import com.benny.openlauncher.util.LauncherAction; 12 | import com.benny.openlauncher.viewutil.DialogHelper; 13 | 14 | public class HpEventHandler implements Setup.EventHandler { 15 | @Override 16 | public void showLauncherSettings(Context context) { 17 | LauncherAction.RunAction(LauncherAction.Action.LauncherSettings, context); 18 | } 19 | 20 | @Override 21 | public void showPickAction(Context context, final DialogListener.OnActionDialogListener listener) { 22 | DialogHelper.selectDesktopActionDialog(context, new MaterialDialog.ListCallback() { 23 | @Override 24 | public void onSelection(MaterialDialog dialog, View itemView, int position, CharSequence text) { 25 | if (position == 0) { 26 | listener.onAdd(Definitions.ACTION_LAUNCHER); 27 | } 28 | } 29 | }); 30 | } 31 | 32 | @Override 33 | public void showEditDialog(Context context, Item item, final DialogListener.OnEditDialogListener listener) { 34 | DialogHelper.editItemDialog("Edit Item", item.getLabel(), context, new DialogHelper.OnItemEditListener() { 35 | @Override 36 | public void itemLabel(String label) { 37 | listener.onRename(label); 38 | } 39 | }); 40 | } 41 | 42 | @Override 43 | public void showDeletePackageDialog(Context context, Item item) { 44 | DialogHelper.deletePackageDialog(context, item); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/activity/homeparts/HpGestureCallback.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.activity.homeparts; 2 | 3 | import android.content.Intent; 4 | import android.util.Log; 5 | 6 | import com.benny.openlauncher.activity.HomeActivity; 7 | import com.benny.openlauncher.manager.Setup; 8 | import com.benny.openlauncher.util.AppSettings; 9 | import com.benny.openlauncher.util.LauncherAction; 10 | import com.benny.openlauncher.util.Tool; 11 | import com.benny.openlauncher.viewutil.DesktopGestureListener; 12 | import com.benny.openlauncher.widget.Desktop; 13 | 14 | public class HpGestureCallback implements DesktopGestureListener.DesktopGestureCallback { 15 | private AppSettings _appSettings; 16 | 17 | HpGestureCallback(AppSettings appSettings) { 18 | _appSettings = appSettings; 19 | } 20 | 21 | @Override 22 | public boolean onDrawerGesture(Desktop desktop, DesktopGestureListener.Type event) { 23 | Object gesture = null; 24 | switch (event) { 25 | case SwipeUp: 26 | gesture = _appSettings.getGestureSwipeUp(); 27 | break; 28 | case SwipeDown: 29 | gesture = _appSettings.getGestureSwipeDown(); 30 | break; 31 | case SwipeLeft: 32 | case SwipeRight: 33 | break; 34 | case Pinch: 35 | gesture = _appSettings.getGesturePinch(); 36 | break; 37 | case Unpinch: 38 | gesture = _appSettings.getGestureUnpinch(); 39 | break; 40 | case DoubleTap: 41 | gesture = _appSettings.getGestureDoubleTap(); 42 | break; 43 | default: 44 | Log.e(getClass().toString(), "gesture error"); 45 | } 46 | 47 | if (gesture != null) { 48 | if (_appSettings.getGestureFeedback()) { 49 | Tool.vibrate(desktop); 50 | } 51 | if (gesture instanceof Intent) { 52 | Intent intent = (Intent) gesture; 53 | Tool.startApp(HomeActivity._launcher, Setup.appLoader().findApp(intent), null); 54 | } else if (gesture instanceof LauncherAction.ActionDisplayItem) { 55 | LauncherAction.RunAction((LauncherAction.ActionDisplayItem) gesture, desktop.getContext()); 56 | } 57 | return true; 58 | } 59 | 60 | return false; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/activity/homeparts/HpInitSetup.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.activity.homeparts; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.NonNull; 5 | 6 | import com.benny.openlauncher.AppObject; 7 | import com.benny.openlauncher.manager.Setup; 8 | import com.benny.openlauncher.util.AppManager; 9 | import com.benny.openlauncher.util.AppSettings; 10 | import com.benny.openlauncher.util.DatabaseHelper; 11 | import com.benny.openlauncher.viewutil.DesktopGestureListener.DesktopGestureCallback; 12 | 13 | public final class HpInitSetup extends Setup { 14 | private final AppManager _appLoader; 15 | private final DatabaseHelper _dataManager; 16 | private final HpGestureCallback _desktopGestureCallback; 17 | private final HpEventHandler _eventHandler; 18 | private final AppSettings _appSettings; 19 | 20 | public HpInitSetup(Context context) { 21 | _appSettings = AppSettings.get(); 22 | _desktopGestureCallback = new HpGestureCallback(_appSettings); 23 | _dataManager = new DatabaseHelper(context.getApplicationContext()); 24 | _appLoader = AppManager.getInstance(context.getApplicationContext()); 25 | _eventHandler = new HpEventHandler(); 26 | } 27 | 28 | @NonNull 29 | public Context getAppContext() { 30 | return AppObject.get(); 31 | } 32 | 33 | @NonNull 34 | public AppSettings getAppSettings() { 35 | return _appSettings; 36 | } 37 | 38 | @NonNull 39 | public DesktopGestureCallback getDesktopGestureCallback() { 40 | return _desktopGestureCallback; 41 | } 42 | 43 | @NonNull 44 | public DatabaseHelper getDataManager() { 45 | return _dataManager; 46 | } 47 | 48 | @NonNull 49 | public AppManager getAppLoader() { 50 | return _appLoader; 51 | } 52 | 53 | @NonNull 54 | public EventHandler getEventHandler() { 55 | return _eventHandler; 56 | } 57 | } -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/activity/homeparts/HpSearchBar.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.activity.homeparts; 2 | 3 | import android.app.SearchManager; 4 | import android.content.Intent; 5 | import android.net.Uri; 6 | import android.view.View; 7 | 8 | import com.benny.openlauncher.activity.HomeActivity; 9 | import com.benny.openlauncher.manager.Setup; 10 | import com.benny.openlauncher.util.Tool; 11 | import com.benny.openlauncher.widget.SearchBar; 12 | 13 | import net.gsantner.opoc.util.ActivityUtils; 14 | 15 | public class HpSearchBar implements SearchBar.CallBack, View.OnClickListener { 16 | private HomeActivity _homeActivity; 17 | private SearchBar _searchBar; 18 | 19 | public HpSearchBar(HomeActivity homeActivity, SearchBar searchBar) { 20 | _homeActivity = homeActivity; 21 | _searchBar = searchBar; 22 | } 23 | 24 | 25 | public void initSearchBar() { 26 | _searchBar.setCallback(this); 27 | _searchBar._searchClock.setOnClickListener(this); 28 | _homeActivity.updateSearchClock(); 29 | } 30 | 31 | @Override 32 | public void onInternetSearch(String string) { 33 | Intent intent = new Intent(); 34 | 35 | if (Tool.isIntentActionAvailable(_homeActivity.getApplicationContext(), Intent.ACTION_WEB_SEARCH) && !Setup.appSettings().getSearchBarForceBrowser()) { 36 | intent.setAction(Intent.ACTION_WEB_SEARCH); 37 | intent.putExtra(SearchManager.QUERY, string); 38 | } else { 39 | String baseUri = Setup.appSettings().getSearchBarBaseURI(); 40 | String searchUri = baseUri.contains("{query}") ? baseUri.replace("{query}", string) : (baseUri + string); 41 | 42 | intent.setAction(Intent.ACTION_VIEW); 43 | intent.setData(Uri.parse(searchUri)); 44 | } 45 | 46 | try { 47 | _homeActivity.startActivity(intent); 48 | } catch (Exception e) { 49 | e.printStackTrace(); 50 | } 51 | } 52 | 53 | @Override 54 | public void onExpand() { 55 | _searchBar._searchInput.setFocusable(true); 56 | _searchBar._searchInput.setFocusableInTouchMode(true); 57 | _searchBar._searchInput.postDelayed(new Runnable() { 58 | @Override 59 | public void run() { 60 | _homeActivity.dimBackground(); 61 | _homeActivity.clearRoomForPopUp(); 62 | _searchBar._searchInput.requestFocus(); 63 | } 64 | }, 100); 65 | Tool.showKeyboard(_homeActivity, _searchBar._searchInput); 66 | } 67 | 68 | @Override 69 | public void onCollapse() { 70 | _homeActivity.getDesktop().postDelayed(new Runnable() { 71 | @Override 72 | public void run() { 73 | _homeActivity.unDimBackground(); 74 | _homeActivity.unClearRoomForPopUp(); 75 | _searchBar._searchInput.clearFocus(); 76 | } 77 | }, 100); 78 | Tool.hideKeyboard(_homeActivity, _searchBar._searchInput); 79 | } 80 | 81 | @Override 82 | public void onClick(View v) { 83 | new ActivityUtils(_homeActivity).startCalendarApp().freeContextRef(); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/fragment/SettingsAppDrawerFragment.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.fragment; 2 | 3 | import android.os.Bundle; 4 | 5 | import com.benny.openlauncher.R; 6 | 7 | public class SettingsAppDrawerFragment extends SettingsBaseFragment { 8 | @Override 9 | public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { 10 | super.onCreatePreferences(savedInstanceState, rootKey); 11 | addPreferencesFromResource(R.xml.preferences_app_drawer); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/fragment/SettingsAppearanceFragment.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.preference.Preference; 5 | 6 | import com.benny.openlauncher.R; 7 | import com.benny.openlauncher.activity.HomeActivity; 8 | import com.benny.openlauncher.viewutil.DialogHelper; 9 | 10 | import net.gsantner.opoc.util.ContextUtils; 11 | 12 | public class SettingsAppearanceFragment extends SettingsBaseFragment { 13 | @Override 14 | public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { 15 | super.onCreatePreferences(savedInstanceState, rootKey); 16 | addPreferencesFromResource(R.xml.preferences_appearance); 17 | } 18 | 19 | @Override 20 | public boolean onPreferenceTreeClick(Preference preference) { 21 | HomeActivity homeActivity = HomeActivity._launcher; 22 | int key = new ContextUtils(homeActivity).getResId(ContextUtils.ResType.STRING, preference.getKey()); 23 | switch (key) { 24 | case R.string.pref_key__icon_pack: 25 | DialogHelper.startPickIconPackIntent(getActivity()); 26 | return true; 27 | } 28 | return false; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/fragment/SettingsBaseFragment.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.fragment; 2 | 3 | import android.content.SharedPreferences; 4 | import android.graphics.PorterDuff; 5 | import android.graphics.drawable.Drawable; 6 | import android.os.Bundle; 7 | import android.support.v7.preference.Preference; 8 | import android.support.v7.preference.PreferenceFragmentCompat; 9 | import android.support.v7.preference.PreferenceGroup; 10 | import android.support.v7.widget.Toolbar; 11 | import android.util.TypedValue; 12 | 13 | import com.benny.openlauncher.R; 14 | import com.benny.openlauncher.util.AppSettings; 15 | 16 | import java.util.ArrayList; 17 | import java.util.Arrays; 18 | import java.util.List; 19 | 20 | public abstract class SettingsBaseFragment extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener { 21 | private static final List noRestart = new ArrayList<>(Arrays.asList( 22 | R.string.pref_key__gesture_double_tap, 23 | R.string.pref_key__gesture_swipe_up, 24 | R.string.pref_key__gesture_swipe_down, 25 | R.string.pref_key__gesture_pinch_in, 26 | R.string.pref_key__gesture_pinch_out 27 | )); 28 | 29 | @Override 30 | public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { 31 | getPreferenceManager().setSharedPreferencesName("app"); 32 | } 33 | 34 | @Override 35 | public void onResume() { 36 | super.onResume(); 37 | 38 | Toolbar toolbar = getActivity().findViewById(R.id.toolbar); 39 | if (toolbar != null) toolbar.setTitle(getPreferenceScreen().getTitle()); 40 | 41 | SharedPreferences sharedPreferences = AppSettings.get().getDefaultPreferences(); 42 | sharedPreferences.registerOnSharedPreferenceChangeListener(this); 43 | 44 | updateIcons(getPreferenceScreen()); 45 | updateSummaries(); 46 | } 47 | 48 | @Override 49 | public void onPause() { 50 | super.onPause(); 51 | 52 | SharedPreferences sharedPreferences = AppSettings.get().getDefaultPreferences(); 53 | sharedPreferences.unregisterOnSharedPreferenceChangeListener(this); 54 | } 55 | 56 | @Override 57 | public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { 58 | updateSummaries(); 59 | if (!noRestart.contains(key)) { 60 | AppSettings.get().setAppRestartRequired(true); 61 | } 62 | } 63 | 64 | public void updateSummaries() { 65 | // override in fragments 66 | } 67 | 68 | public void updateIcons(PreferenceGroup prefGroup) { 69 | if (prefGroup != null && isAdded()) { 70 | int prefCount = prefGroup.getPreferenceCount(); 71 | for (int i = 0; i < prefCount; i++) { 72 | Preference preference = prefGroup.getPreference(i); 73 | if (preference != null) { 74 | Drawable drawable = preference.getIcon(); 75 | if (drawable != null) { 76 | TypedValue color = new TypedValue(); 77 | getContext().getTheme().resolveAttribute(android.R.attr.textColor, color, true); 78 | drawable.mutate().setColorFilter(getResources().getColor(color.resourceId), PorterDuff.Mode.SRC_IN); 79 | } 80 | 81 | if (preference instanceof PreferenceGroup) { 82 | updateIcons((PreferenceGroup) preference); 83 | } 84 | } 85 | } 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/fragment/SettingsDesktopFragment.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.preference.Preference; 5 | 6 | import com.benny.openlauncher.R; 7 | import com.benny.openlauncher.activity.HomeActivity; 8 | import com.benny.openlauncher.util.LauncherAction; 9 | 10 | import net.gsantner.opoc.util.ContextUtils; 11 | 12 | public class SettingsDesktopFragment extends SettingsBaseFragment { 13 | @Override 14 | public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { 15 | super.onCreatePreferences(savedInstanceState, rootKey); 16 | addPreferencesFromResource(R.xml.preferences_desktop); 17 | } 18 | 19 | @Override 20 | public boolean onPreferenceTreeClick(Preference preference) { 21 | HomeActivity homeActivity = HomeActivity._launcher; 22 | int key = new ContextUtils(homeActivity).getResId(ContextUtils.ResType.STRING, preference.getKey()); 23 | switch (key) { 24 | case R.string.pref_key__minibar: 25 | LauncherAction.RunAction(LauncherAction.Action.EditMinibar, getActivity()); 26 | return true; 27 | } 28 | return false; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/fragment/SettingsDockFragment.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.fragment; 2 | 3 | import android.os.Bundle; 4 | 5 | import com.benny.openlauncher.R; 6 | 7 | public class SettingsDockFragment extends SettingsBaseFragment { 8 | @Override 9 | public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { 10 | super.onCreatePreferences(savedInstanceState, rootKey); 11 | addPreferencesFromResource(R.xml.preferences_dock); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/fragment/SettingsMasterFragment.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.fragment; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.v7.preference.Preference; 6 | 7 | import com.benny.openlauncher.R; 8 | import com.benny.openlauncher.activity.HideAppsActivity; 9 | import com.benny.openlauncher.activity.HomeActivity; 10 | import com.benny.openlauncher.activity.MoreInfoActivity; 11 | import com.benny.openlauncher.util.AppSettings; 12 | 13 | import net.gsantner.opoc.util.ContextUtils; 14 | 15 | import java.util.Locale; 16 | 17 | import static com.benny.openlauncher.widget.AppDrawerController.Mode.GRID; 18 | import static com.benny.openlauncher.widget.AppDrawerController.Mode.PAGE; 19 | 20 | public class SettingsMasterFragment extends SettingsBaseFragment { 21 | @Override 22 | public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { 23 | super.onCreatePreferences(savedInstanceState, rootKey); 24 | addPreferencesFromResource(R.xml.preferences_master); 25 | } 26 | 27 | @Override 28 | public boolean onPreferenceTreeClick(Preference preference) { 29 | super.onPreferenceTreeClick(preference); 30 | HomeActivity homeActivity = HomeActivity._launcher; 31 | int key = new ContextUtils(homeActivity).getResId(ContextUtils.ResType.STRING, preference.getKey()); 32 | switch (key) { 33 | case R.string.pref_key__cat_hide_apps: 34 | Intent intent = new Intent(getActivity(), HideAppsActivity.class); 35 | intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); 36 | startActivity(intent); 37 | return true; 38 | case R.string.pref_key__cat_about: 39 | startActivity(new Intent(getActivity(), MoreInfoActivity.class)); 40 | return true; 41 | } 42 | 43 | return false; 44 | } 45 | 46 | @Override 47 | public void updateSummaries() { 48 | Preference categoryDesktop = findPreference(getString(R.string.pref_key__cat_desktop)); 49 | Preference categoryDock = findPreference(getString(R.string.pref_key__cat_dock)); 50 | Preference categoryAppDrawer = findPreference(getString(R.string.pref_key__cat_app_drawer)); 51 | Preference categoryAppearance = findPreference(getString(R.string.pref_key__cat_appearance)); 52 | 53 | categoryDesktop.setSummary(String.format(Locale.ENGLISH, "%s: %d x %d", getString(R.string.pref_title__size), AppSettings.get().getDesktopColumnCount(), AppSettings.get().getDesktopRowCount())); 54 | categoryDock.setSummary(String.format(Locale.ENGLISH, "%s: %d x %d", getString(R.string.pref_title__size), AppSettings.get().getDockColumnCount(), AppSettings.get().getDockRowCount())); 55 | categoryAppearance.setSummary(String.format(Locale.ENGLISH, "%s: %ddp", getString(R.string.pref_title__icons), AppSettings.get().getIconSize())); 56 | 57 | switch (AppSettings.get().getDrawerStyle()) { 58 | case GRID: 59 | categoryAppDrawer.setSummary(String.format("%s: %s", getString(R.string.pref_title__style), getString(R.string.vertical_scroll_drawer))); 60 | break; 61 | case PAGE: 62 | default: 63 | categoryAppDrawer.setSummary(String.format("%s: %s", getString(R.string.pref_title__style), getString(R.string.horizontal_paged_drawer))); 64 | break; 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/interfaces/AppDeleteListener.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.interfaces; 2 | 3 | import com.benny.openlauncher.model.App; 4 | 5 | import java.util.List; 6 | 7 | public interface AppDeleteListener { 8 | boolean onAppDeleted(List apps); 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/interfaces/AppUpdateListener.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.interfaces; 2 | 3 | import com.benny.openlauncher.model.App; 4 | 5 | import java.util.List; 6 | 7 | public interface AppUpdateListener { 8 | boolean onAppUpdated(List apps); 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/interfaces/DialogListener.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.interfaces; 2 | 3 | public interface DialogListener { 4 | 5 | interface OnActionDialogListener { 6 | void onAdd(int type); 7 | } 8 | 9 | interface OnEditDialogListener { 10 | void onRename(String name); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/interfaces/DropTargetListener.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.interfaces; 2 | 3 | import android.graphics.PointF; 4 | import android.view.View; 5 | 6 | import com.benny.openlauncher.model.Item; 7 | import com.benny.openlauncher.util.DragAction; 8 | 9 | public interface DropTargetListener { 10 | View getView(); 11 | 12 | boolean onStart(DragAction.Action action, PointF location, boolean isInside); 13 | 14 | void onStartDrag(DragAction.Action action, PointF location); 15 | 16 | void onDrop(DragAction.Action action, PointF location, Item item); 17 | 18 | void onMove(DragAction.Action action, PointF location); 19 | 20 | void onEnter(DragAction.Action action, PointF location); 21 | 22 | void onExit(DragAction.Action action, PointF location); 23 | 24 | void onEnd(); 25 | } -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/interfaces/ItemHistory.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.interfaces; 2 | 3 | import android.view.View; 4 | 5 | import com.benny.openlauncher.model.Item; 6 | 7 | public interface ItemHistory { 8 | void setLastItem(Item item, View view); 9 | 10 | void revertLastItem(); 11 | 12 | void consumeLastItem(); 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/manager/Setup.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.manager; 2 | 3 | import android.content.Context; 4 | 5 | import com.benny.openlauncher.interfaces.DialogListener; 6 | import com.benny.openlauncher.model.Item; 7 | import com.benny.openlauncher.util.AppManager; 8 | import com.benny.openlauncher.util.AppSettings; 9 | import com.benny.openlauncher.util.DatabaseHelper; 10 | import com.benny.openlauncher.viewutil.DesktopGestureListener; 11 | 12 | public abstract class Setup { 13 | private static Setup _setup = null; 14 | 15 | public static boolean wasInitialised() { 16 | return _setup != null; 17 | } 18 | 19 | public static void init(Setup setup) { 20 | Setup._setup = setup; 21 | } 22 | 23 | public static Setup get() { 24 | if (_setup == null) { 25 | throw new RuntimeException("Setup has not been initialised!"); 26 | } 27 | return _setup; 28 | } 29 | 30 | public static Context appContext() { 31 | return get().getAppContext(); 32 | } 33 | 34 | public static AppSettings appSettings() { 35 | return get().getAppSettings(); 36 | } 37 | 38 | public static DesktopGestureListener.DesktopGestureCallback desktopGestureCallback() { 39 | return get().getDesktopGestureCallback(); 40 | } 41 | 42 | public static DatabaseHelper dataManager() { 43 | return get().getDataManager(); 44 | } 45 | 46 | public static AppManager appLoader() { 47 | return get().getAppLoader(); 48 | } 49 | 50 | public static EventHandler eventHandler() { 51 | return get().getEventHandler(); 52 | } 53 | 54 | public abstract Context getAppContext(); 55 | 56 | public abstract AppSettings getAppSettings(); 57 | 58 | public abstract DesktopGestureListener.DesktopGestureCallback getDesktopGestureCallback(); 59 | 60 | public abstract DatabaseHelper getDataManager(); 61 | 62 | public abstract AppManager getAppLoader(); 63 | 64 | public abstract EventHandler getEventHandler(); 65 | 66 | public interface EventHandler { 67 | void showLauncherSettings(Context context); 68 | 69 | void showPickAction(Context context, DialogListener.OnActionDialogListener listener); 70 | 71 | void showEditDialog(Context context, Item item, DialogListener.OnEditDialogListener listener); 72 | 73 | void showDeletePackageDialog(Context context, Item item); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/model/App.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.model; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.content.ComponentName; 5 | import android.content.pm.LauncherActivityInfo; 6 | import android.content.pm.PackageManager; 7 | import android.content.pm.ResolveInfo; 8 | import android.content.pm.ShortcutInfo; 9 | import android.graphics.drawable.Drawable; 10 | import android.os.UserHandle; 11 | 12 | import java.util.List; 13 | 14 | public class App { 15 | public Drawable _icon; 16 | public String _label; 17 | public String _packageName; 18 | public String _className; 19 | public UserHandle _userHandle; 20 | public List _shortcutInfo; 21 | 22 | public App(PackageManager pm, ResolveInfo info, List shortcutInfo) { 23 | _icon = info.loadIcon(pm); 24 | _label = info.loadLabel(pm).toString(); 25 | _packageName = info.activityInfo.packageName; 26 | _className = info.activityInfo.name; 27 | _shortcutInfo = shortcutInfo; 28 | } 29 | 30 | @SuppressLint("NewApi") 31 | public App(PackageManager pm, LauncherActivityInfo info, List shortcutInfo) { 32 | _icon = info.getIcon(0); 33 | _label = info.getLabel().toString(); 34 | _packageName = info.getComponentName().getPackageName(); 35 | _className = info.getName(); 36 | _shortcutInfo = shortcutInfo; 37 | } 38 | 39 | @Override 40 | public boolean equals(Object object) { 41 | if (object instanceof App) { 42 | App app = (App) object; 43 | return _packageName.equals(app._packageName); 44 | } else { 45 | return false; 46 | } 47 | } 48 | 49 | public void setIcon(Drawable icon) { 50 | _icon = icon; 51 | } 52 | 53 | public Drawable getIcon() { 54 | return _icon; 55 | } 56 | 57 | public String getLabel() { 58 | return _label; 59 | } 60 | 61 | public String getPackageName() { 62 | return _packageName; 63 | } 64 | 65 | public String getClassName() { 66 | return _className; 67 | } 68 | 69 | public String getComponentName() { 70 | return new ComponentName(_packageName, _className).toString(); 71 | } 72 | 73 | public List getShortcutInfo() { 74 | return _shortcutInfo; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/receivers/AppUpdateReceiver.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.receivers; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | 7 | import com.benny.openlauncher.manager.Setup; 8 | 9 | public class AppUpdateReceiver extends BroadcastReceiver { 10 | @Override 11 | public void onReceive(Context context, Intent intent) { 12 | Setup.appLoader().onAppUpdated(context, intent); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/receivers/DeviceAdminReceiver.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.receivers; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.util.Log; 7 | 8 | public class DeviceAdminReceiver extends BroadcastReceiver { 9 | @Override 10 | public void onReceive(Context context, Intent intent) { 11 | Log.d("DeviceAdminReceiver", "DeviceAdmin received"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/receivers/ShortcutReceiver.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.receivers; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.res.Resources; 7 | import android.graphics.Bitmap; 8 | import android.graphics.Point; 9 | import android.graphics.drawable.BitmapDrawable; 10 | import android.graphics.drawable.Drawable; 11 | import android.os.Parcelable; 12 | import android.util.Log; 13 | 14 | import com.benny.openlauncher.R; 15 | import com.benny.openlauncher.activity.HomeActivity; 16 | import com.benny.openlauncher.activity.homeparts.HpInitSetup; 17 | import com.benny.openlauncher.manager.Setup; 18 | import com.benny.openlauncher.model.App; 19 | import com.benny.openlauncher.model.Item; 20 | import com.benny.openlauncher.util.Definitions; 21 | import com.benny.openlauncher.util.Tool; 22 | 23 | public class ShortcutReceiver extends BroadcastReceiver { 24 | 25 | public ShortcutReceiver() { 26 | } 27 | 28 | @Override 29 | public void onReceive(Context context, Intent intent) { 30 | if (intent.getExtras() == null) return; 31 | 32 | // this will only work before Android Oreo 33 | // was deprecated in favor of ShortcutManager.pinRequestShortcut() 34 | String shortcutLabel = intent.getExtras().getString(Intent.EXTRA_SHORTCUT_NAME); 35 | Intent shortcutIntent = (Intent) intent.getExtras().get(Intent.EXTRA_SHORTCUT_INTENT); 36 | Drawable shortcutIcon = null; 37 | 38 | try { 39 | Parcelable parcelable = intent.getExtras().getParcelable(Intent.EXTRA_SHORTCUT_ICON_RESOURCE); 40 | if (parcelable instanceof Intent.ShortcutIconResource) { 41 | Intent.ShortcutIconResource iconResource = (Intent.ShortcutIconResource) parcelable; 42 | Resources resources = context.getPackageManager().getResourcesForApplication(iconResource.packageName); 43 | if (resources != null) { 44 | int id = resources.getIdentifier(iconResource.resourceName, null, null); 45 | shortcutIcon = resources.getDrawable(id); 46 | } 47 | } 48 | } catch (Exception e) { 49 | e.printStackTrace(); 50 | } finally { 51 | if (shortcutIcon == null) 52 | shortcutIcon = new BitmapDrawable(context.getResources(), (Bitmap) intent.getExtras().getParcelable(Intent.EXTRA_SHORTCUT_ICON)); 53 | } 54 | 55 | if (!Setup.wasInitialised()) { 56 | Setup.init(new HpInitSetup(context)); 57 | } 58 | 59 | App app = Setup.appLoader().createApp(shortcutIntent); 60 | Item item; 61 | if (app != null) { 62 | item = Item.newAppItem(app); 63 | } else { 64 | item = Item.newShortcutItem(shortcutIntent, shortcutIcon, shortcutLabel); 65 | } 66 | Point preferredPos = HomeActivity.Companion.getLauncher().getDesktop().getPages().get(HomeActivity.Companion.getLauncher().getDesktop().getCurrentItem()).findFreeSpace(); 67 | if (preferredPos == null) { 68 | Tool.toast(HomeActivity.Companion.getLauncher(), R.string.toast_not_enough_space); 69 | } else { 70 | item.setX(preferredPos.x); 71 | item.setY(preferredPos.y); 72 | HomeActivity._db.saveItem(item, HomeActivity.Companion.getLauncher().getDesktop().getCurrentItem(), Definitions.ItemPosition.Desktop); 73 | HomeActivity.Companion.getLauncher().getDesktop().addItemToPage(item, HomeActivity.Companion.getLauncher().getDesktop().getCurrentItem()); 74 | Log.d(this.getClass().toString(), "shortcut installed"); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/util/Definitions.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.util; 2 | 3 | public class Definitions { 4 | public static final int BUFFER_SIZE = 2048; 5 | public static final int INTENT_BACKUP = 5; 6 | public static final int INTENT_RESTORE = 3; 7 | public static final int ACTION_LAUNCHER = 8; 8 | 9 | // separates a list of integers 10 | public static final String DELIMITER = "#"; 11 | 12 | // DO NOT REARRANGE 13 | // enum ordinal used for db 14 | public enum ItemPosition { 15 | Dock, 16 | Desktop, 17 | Group 18 | } 19 | 20 | public enum ItemState { 21 | Hidden, 22 | Visible 23 | } 24 | 25 | public enum WallpaperScroll { 26 | Normal, 27 | Inverse, 28 | Off 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/util/DragAction.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.util; 2 | 3 | public class DragAction { 4 | public Action action; 5 | 6 | public DragAction(Action action) { 7 | this.action = action; 8 | } 9 | 10 | public enum Action { 11 | DESKTOP, DRAWER, SEARCH 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/util/DragHandler.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.util; 2 | 3 | import android.graphics.Bitmap; 4 | import android.graphics.Bitmap.Config; 5 | import android.graphics.Canvas; 6 | import android.view.View; 7 | 8 | import com.benny.openlauncher.activity.HomeActivity; 9 | import com.benny.openlauncher.manager.Setup; 10 | import com.benny.openlauncher.model.Item; 11 | import com.benny.openlauncher.viewutil.DesktopCallback; 12 | import com.benny.openlauncher.widget.AppItemView; 13 | 14 | public final class DragHandler { 15 | public static Bitmap _cachedDragBitmap; 16 | 17 | public static void startDrag(View view, Item item, DragAction.Action action, final DesktopCallback desktopCallback) { 18 | _cachedDragBitmap = loadBitmapFromView(view); 19 | 20 | if (HomeActivity.Companion.getLauncher() != null) 21 | HomeActivity._launcher.getItemOptionView().startDragNDropOverlay(view, item, action); 22 | 23 | if (desktopCallback != null) 24 | desktopCallback.setLastItem(item, view); 25 | } 26 | 27 | public static View.OnLongClickListener getLongClick(final Item item, final DragAction.Action action, final DesktopCallback desktopCallback) { 28 | return new View.OnLongClickListener() { 29 | @Override 30 | public boolean onLongClick(View view) { 31 | if (Setup.appSettings().getDesktopLock()) { 32 | if (HomeActivity.Companion.getLauncher() != null && !DragAction.Action.SEARCH.equals(action)) { 33 | if (Setup.appSettings().getGestureFeedback()) { 34 | Tool.vibrate(view); 35 | } 36 | HomeActivity._launcher.getItemOptionView().showItemPopupForLockedDesktop(item, HomeActivity.Companion.getLauncher()); 37 | return true; 38 | } 39 | return false; 40 | } 41 | if (Setup.appSettings().getGestureFeedback()) { 42 | Tool.vibrate(view); 43 | } 44 | startDrag(view, item, action, desktopCallback); 45 | return true; 46 | } 47 | }; 48 | } 49 | 50 | private static Bitmap loadBitmapFromView(View view) { 51 | Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Config.ARGB_8888); 52 | Canvas canvas = new Canvas(bitmap); 53 | String tempLabel = null; 54 | if (view instanceof AppItemView) { 55 | tempLabel = ((AppItemView) view).getLabel(); 56 | ((AppItemView) view).setLabel(" "); 57 | } 58 | view.layout(0, 0, view.getWidth(), view.getHeight()); 59 | view.draw(canvas); 60 | if (view instanceof AppItemView) { 61 | ((AppItemView) view).setLabel(tempLabel); 62 | } 63 | view.getParent().requestLayout(); 64 | return bitmap; 65 | } 66 | } -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/viewutil/AbstractPopupIconLabelItem.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.viewutil; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | import android.view.View; 5 | import android.widget.ImageView; 6 | import android.widget.TextView; 7 | 8 | import com.benny.openlauncher.R; 9 | import com.mikepenz.fastadapter.IClickable; 10 | import com.mikepenz.fastadapter.IItem; 11 | import com.mikepenz.fastadapter.items.AbstractItem; 12 | 13 | public abstract class AbstractPopupIconLabelItem extends AbstractItem { 14 | 15 | static class ViewHolder extends RecyclerView.ViewHolder { 16 | ImageView iconView; 17 | TextView labelView; 18 | 19 | ViewHolder(View itemView) { 20 | super(itemView); 21 | 22 | labelView = itemView.findViewById(R.id.item_popup_label); 23 | iconView = itemView.findViewById(R.id.item_popup_icon); 24 | } 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/viewutil/CircleDrawable.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.viewutil; 2 | 3 | import android.content.Context; 4 | import android.graphics.Bitmap; 5 | import android.graphics.Canvas; 6 | import android.graphics.ColorFilter; 7 | import android.graphics.Paint; 8 | import android.graphics.PixelFormat; 9 | import android.graphics.PorterDuff; 10 | import android.graphics.drawable.Drawable; 11 | 12 | import com.benny.openlauncher.util.Tool; 13 | 14 | public class CircleDrawable extends Drawable { 15 | 16 | private int _iconSize; 17 | private int _iconSizeReal; 18 | private int _iconPadding; 19 | private int _iconColor; 20 | private Bitmap _icon; 21 | private Bitmap _iconToFade; 22 | private Paint _paint; 23 | private Paint _paint2; 24 | 25 | private float _scaleStep = 0.08f; 26 | private float _currentScale = 1f; 27 | private boolean _hidingOldIcon; 28 | 29 | public CircleDrawable(Context context, Drawable icon, int colorIcon, int colorBackground, int alphaBackground) { 30 | icon.setColorFilter(colorIcon, PorterDuff.Mode.SRC_ATOP); 31 | _icon = Tool.drawableToBitmap(icon); 32 | 33 | _iconPadding = Tool.dp2px(6); 34 | _iconColor = colorIcon; 35 | 36 | _iconSizeReal = icon.getIntrinsicHeight(); 37 | _iconSize = icon.getIntrinsicHeight() + _iconPadding * 2; 38 | 39 | _paint = new Paint(Paint.ANTI_ALIAS_FLAG); 40 | _paint.setColor(colorBackground); 41 | _paint.setAlpha(alphaBackground); 42 | _paint.setStyle(Paint.Style.FILL); 43 | 44 | _paint2 = new Paint(Paint.ANTI_ALIAS_FLAG); 45 | _paint2.setColor(colorIcon); 46 | _paint2.setFilterBitmap(true); 47 | } 48 | 49 | public void setIcon(Drawable icon) { 50 | _iconToFade = _icon; 51 | _hidingOldIcon = true; 52 | 53 | icon.setColorFilter(_iconColor, PorterDuff.Mode.SRC_ATOP); 54 | 55 | _icon = Tool.drawableToBitmap(icon); 56 | invalidateSelf(); 57 | } 58 | 59 | @Override 60 | public void draw(Canvas canvas) { 61 | canvas.drawCircle(_iconSize / 2, _iconSize / 2, _iconSize / 2, _paint); 62 | 63 | if (_iconToFade != null) { 64 | canvas.save(); 65 | if (_hidingOldIcon) 66 | _currentScale -= _scaleStep; 67 | else 68 | _currentScale += _scaleStep; 69 | _currentScale = Tool.clampFloat(_currentScale, 0, 1); 70 | canvas.scale(_currentScale, _currentScale, _iconSize / 2, _iconSize / 2); 71 | canvas.drawBitmap(_hidingOldIcon ? _iconToFade : _icon, _iconSize / 2 - _iconSizeReal / 2, _iconSize / 2 - _iconSizeReal / 2, _paint2); 72 | canvas.restore(); 73 | 74 | if (_currentScale == 0) 75 | _hidingOldIcon = false; 76 | 77 | if (!_hidingOldIcon && _scaleStep == 1) 78 | _iconToFade = null; 79 | 80 | invalidateSelf(); 81 | } else { 82 | canvas.drawBitmap(_icon, _iconSize / 2 - _iconSizeReal / 2, _iconSize / 2 - _iconSizeReal / 2, _paint2); 83 | } 84 | } 85 | 86 | @Override 87 | public int getIntrinsicWidth() { 88 | return _iconSize; 89 | } 90 | 91 | @Override 92 | public int getIntrinsicHeight() { 93 | return _iconSize; 94 | } 95 | 96 | @Override 97 | public void setAlpha(int i) { 98 | } 99 | 100 | @Override 101 | public void setColorFilter(ColorFilter colorFilter) { 102 | } 103 | 104 | @Override 105 | public int getOpacity() { 106 | return PixelFormat.TRANSPARENT; 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/viewutil/DesktopCallback.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.viewutil; 2 | 3 | import android.view.View; 4 | 5 | import com.benny.openlauncher.interfaces.ItemHistory; 6 | import com.benny.openlauncher.model.Item; 7 | 8 | public interface DesktopCallback extends ItemHistory { 9 | boolean addItemToPoint(Item item, int x, int y); 10 | 11 | boolean addItemToPage(Item item, int page); 12 | 13 | boolean addItemToCell(Item item, int x, int y); 14 | 15 | void removeItem(View view, boolean animate); 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/viewutil/DesktopGestureListener.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.viewutil; 2 | 3 | import com.benny.openlauncher.widget.Desktop; 4 | 5 | import in.championswimmer.sfg.lib.SimpleFingerGestures; 6 | 7 | public class DesktopGestureListener implements SimpleFingerGestures.OnFingerGestureListener { 8 | 9 | public enum Type { 10 | SwipeUp, 11 | SwipeDown, 12 | SwipeLeft, 13 | SwipeRight, 14 | Pinch, 15 | Unpinch, 16 | DoubleTap 17 | } 18 | 19 | private final DesktopGestureCallback _callback; 20 | private final Desktop _desktop; 21 | 22 | public DesktopGestureListener(Desktop desktop, DesktopGestureCallback callback) { 23 | _desktop = desktop; 24 | _callback = callback; 25 | } 26 | 27 | @Override 28 | public boolean onSwipeUp(int i, long l, double v) { 29 | return _callback.onDrawerGesture(_desktop, Type.SwipeUp); 30 | } 31 | 32 | @Override 33 | public boolean onSwipeDown(int i, long l, double v) { 34 | return _callback.onDrawerGesture(_desktop, Type.SwipeDown); 35 | } 36 | 37 | @Override 38 | public boolean onSwipeLeft(int i, long l, double v) { 39 | return _callback.onDrawerGesture(_desktop, Type.SwipeLeft); 40 | } 41 | 42 | @Override 43 | public boolean onSwipeRight(int i, long l, double v) { 44 | return _callback.onDrawerGesture(_desktop, Type.SwipeRight); 45 | } 46 | 47 | @Override 48 | public boolean onPinch(int i, long l, double v) { 49 | return _callback.onDrawerGesture(_desktop, Type.Pinch); 50 | } 51 | 52 | @Override 53 | public boolean onUnpinch(int i, long l, double v) { 54 | return _callback.onDrawerGesture(_desktop, Type.Unpinch); 55 | } 56 | 57 | @Override 58 | public boolean onDoubleTap(int i) { 59 | return _callback.onDrawerGesture(_desktop, Type.DoubleTap); 60 | } 61 | 62 | public interface DesktopGestureCallback { 63 | boolean onDrawerGesture(Desktop desktop, Type event); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/viewutil/DrawerAppItem.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.viewutil; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | import android.view.View; 5 | 6 | import com.benny.openlauncher.R; 7 | import com.benny.openlauncher.manager.Setup; 8 | import com.benny.openlauncher.model.App; 9 | import com.benny.openlauncher.model.Item; 10 | import com.benny.openlauncher.util.DragAction; 11 | import com.benny.openlauncher.widget.AppDrawerGrid; 12 | import com.benny.openlauncher.widget.AppItemView; 13 | import com.mikepenz.fastadapter.items.AbstractItem; 14 | 15 | import java.util.List; 16 | 17 | public class DrawerAppItem extends AbstractItem { 18 | private App _app; 19 | 20 | public DrawerAppItem(App app) { 21 | // TODO merge IconLabelItem and DrawerAppItem into one class 22 | // they both do the same thing 23 | // ideally remove all the custom code for AppItemView in favor of the 24 | // nicer code in IconLabelItem 25 | _app = app; 26 | } 27 | 28 | @Override 29 | public int getType() { 30 | return R.id.id_adapter_drawer_app_item; 31 | } 32 | 33 | @Override 34 | public int getLayoutRes() { 35 | return R.layout.item_app; 36 | } 37 | 38 | @Override 39 | public ViewHolder getViewHolder(View v) { 40 | return new ViewHolder(v); 41 | } 42 | 43 | @Override 44 | public void bindView(DrawerAppItem.ViewHolder holder, List payloads) { 45 | Item item = Item.newAppItem(_app); 46 | holder.builder 47 | .setAppItem(item) 48 | .withOnLongClick(item, DragAction.Action.DRAWER, null); 49 | super.bindView(holder, payloads); 50 | } 51 | 52 | static class ViewHolder extends RecyclerView.ViewHolder { 53 | AppItemView appItemView; 54 | AppItemView.Builder builder; 55 | 56 | public ViewHolder(View itemView) { 57 | super(itemView); 58 | appItemView = (AppItemView) itemView; 59 | appItemView.setTargetedWidth(AppDrawerGrid._itemWidth); 60 | appItemView.setTargetedHeightPadding(AppDrawerGrid._itemHeightPadding); 61 | 62 | builder = new AppItemView.Builder(appItemView) 63 | .setIconSize(Setup.appSettings().getIconSize()) 64 | .setLabelVisibility(Setup.appSettings().getDrawerShowLabel()) 65 | .setTextColor(Setup.appSettings().getDrawerLabelColor()); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/viewutil/MinibarAdapter.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.viewutil; 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.BaseAdapter; 8 | import android.widget.ImageView; 9 | import android.widget.TextView; 10 | 11 | import com.benny.openlauncher.R; 12 | import com.benny.openlauncher.util.LauncherAction; 13 | 14 | import java.util.List; 15 | 16 | public class MinibarAdapter extends BaseAdapter { 17 | 18 | private Context context; 19 | private List items; 20 | 21 | public MinibarAdapter(Context context, List items) { 22 | this.context = context; 23 | this.items = items; 24 | } 25 | 26 | public int getCount() { 27 | return items.size(); 28 | } 29 | 30 | public Object getItem(int arg0) { 31 | return null; 32 | } 33 | 34 | public long getItemId(int position) { 35 | return position; 36 | } 37 | 38 | public View getView(int position, View convertView, ViewGroup parent) { 39 | LayoutInflater inflater = LayoutInflater.from(context); 40 | View view = inflater.inflate(R.layout.item_minibar, parent, false); 41 | 42 | ImageView icon = view.findViewById(R.id.iv); 43 | TextView label = view.findViewById(R.id.tv); 44 | 45 | icon.setImageResource(items.get(position)._icon); 46 | label.setText(items.get(position)._label); 47 | return view; 48 | } 49 | } -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/viewutil/PopupDynamicIconLabelItem.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.viewutil; 2 | 3 | import android.graphics.drawable.Drawable; 4 | import android.support.annotation.NonNull; 5 | import android.view.View; 6 | import android.widget.ImageView; 7 | import android.widget.TextView; 8 | 9 | import com.benny.openlauncher.R; 10 | 11 | import java.util.List; 12 | 13 | public final class PopupDynamicIconLabelItem extends AbstractPopupIconLabelItem { 14 | private final Drawable _icon; 15 | private final CharSequence _label; 16 | 17 | public PopupDynamicIconLabelItem(CharSequence label, Drawable icon) { 18 | _label = label; 19 | _icon = icon; 20 | } 21 | 22 | public int getType() { 23 | return R.id.id_adapter_popup_icon_label_item; 24 | } 25 | 26 | public int getLayoutRes() { 27 | return R.layout.item_popup_icon_label; 28 | } 29 | 30 | public void bindView(@NonNull ViewHolder holder, @NonNull List payloads) { 31 | super.bindView(holder, payloads); 32 | 33 | TextView labelView = holder.labelView; 34 | if (labelView != null) { 35 | labelView.setText(_label); 36 | } 37 | 38 | ImageView iconView = holder.iconView; 39 | iconView.setImageDrawable(_icon); 40 | } 41 | 42 | public void unbindView(@NonNull ViewHolder holder) { 43 | super.unbindView(holder); 44 | 45 | TextView labelView = holder.labelView; 46 | labelView.setText(null); 47 | 48 | ImageView iconView = holder.iconView; 49 | iconView.setImageDrawable(null); 50 | } 51 | 52 | @NonNull 53 | @Override 54 | public ViewHolder getViewHolder(@NonNull View view) { 55 | return new ViewHolder(view); 56 | } 57 | } -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/viewutil/PopupIconLabelItem.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.viewutil; 2 | 3 | import android.support.annotation.NonNull; 4 | import android.view.View; 5 | import android.widget.ImageView; 6 | import android.widget.TextView; 7 | 8 | import com.benny.openlauncher.R; 9 | 10 | import java.util.List; 11 | 12 | public final class PopupIconLabelItem extends AbstractPopupIconLabelItem { 13 | private final int _iconRes; 14 | private final int _labelRes; 15 | 16 | public PopupIconLabelItem(int labelRes, int iconRes) { 17 | _labelRes = labelRes; 18 | _iconRes = iconRes; 19 | } 20 | 21 | public int getType() { 22 | return R.id.id_adapter_popup_icon_label_item; 23 | } 24 | 25 | public int getLayoutRes() { 26 | return R.layout.item_popup_icon_label; 27 | } 28 | 29 | public void bindView(@NonNull ViewHolder holder, @NonNull List payloads) { 30 | super.bindView(holder, payloads); 31 | 32 | TextView labelView = holder.labelView; 33 | if (labelView != null) { 34 | labelView.setText(_labelRes); 35 | } 36 | 37 | ImageView iconView = holder.iconView; 38 | iconView.setImageResource(_iconRes); 39 | } 40 | 41 | public void unbindView(@NonNull ViewHolder holder) { 42 | super.unbindView(holder); 43 | 44 | TextView labelView = holder.labelView; 45 | labelView.setText(null); 46 | 47 | ImageView iconView = holder.iconView; 48 | iconView.setImageDrawable(null); 49 | } 50 | 51 | @Override 52 | public ViewHolder getViewHolder(@NonNull View view) { 53 | return new ViewHolder(view); 54 | } 55 | } -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/viewutil/WidgetHost.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.viewutil; 2 | 3 | import android.appwidget.AppWidgetHost; 4 | import android.appwidget.AppWidgetHostView; 5 | import android.appwidget.AppWidgetProviderInfo; 6 | import android.content.Context; 7 | 8 | import com.benny.openlauncher.widget.WidgetView; 9 | 10 | public class WidgetHost extends AppWidgetHost { 11 | 12 | public WidgetHost(Context context, int hostId) { 13 | super(context, hostId); 14 | } 15 | 16 | @Override 17 | protected AppWidgetHostView onCreateView(Context context, int appWidgetId, AppWidgetProviderInfo appWidget) { 18 | return new WidgetView(context); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/widget/ColorPreferenceCategory.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.widget; 2 | 3 | import android.content.Context; 4 | import android.support.v7.preference.PreferenceCategory; 5 | import android.support.v7.preference.PreferenceViewHolder; 6 | import android.util.AttributeSet; 7 | import android.widget.TextView; 8 | 9 | import com.benny.openlauncher.util.AppSettings; 10 | 11 | public class ColorPreferenceCategory extends PreferenceCategory { 12 | public ColorPreferenceCategory(Context context) { 13 | super(context); 14 | } 15 | 16 | public ColorPreferenceCategory(Context context, AttributeSet attrs) { 17 | super(context, attrs); 18 | } 19 | 20 | public ColorPreferenceCategory(Context context, AttributeSet attrs, int defStyle) { 21 | super(context, attrs, defStyle); 22 | } 23 | 24 | @Override 25 | public void onBindViewHolder(PreferenceViewHolder holder) { 26 | super.onBindViewHolder(holder); 27 | TextView titleView = (TextView) holder.findViewById(android.R.id.title); 28 | titleView.setTextColor(AppSettings.get().getPrimaryColor()); 29 | } 30 | } -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/widget/MinibarView.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.widget; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.view.GestureDetector; 6 | import android.view.MotionEvent; 7 | import android.widget.ListView; 8 | 9 | import com.benny.openlauncher.util.Tool; 10 | 11 | public class MinibarView extends ListView { 12 | private GestureDetector _gestureDetector; 13 | 14 | public void setOnSwipeRight(OnSwipeRight onSwipeRight) { 15 | _onSwipeRight = onSwipeRight; 16 | } 17 | 18 | private OnSwipeRight _onSwipeRight; 19 | 20 | public MinibarView(Context context) { 21 | super(context); 22 | init(); 23 | } 24 | 25 | public MinibarView(Context context, AttributeSet attrs) { 26 | super(context, attrs); 27 | init(); 28 | } 29 | 30 | public MinibarView(Context context, AttributeSet attrs, int defStyleAttr) { 31 | super(context, attrs, defStyleAttr); 32 | init(); 33 | } 34 | 35 | private void init() { 36 | if (isInEditMode()) return; 37 | 38 | final float dis = Tool.dp2px(10); 39 | final float vDis = Tool.dp2px(30); 40 | _gestureDetector = new GestureDetector(getContext(), new GestureDetector.SimpleOnGestureListener() { 41 | public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { 42 | if (e1 == null) return true; 43 | int dx = (int) (e2.getX() - e1.getX()); 44 | int dy = (int) (e2.getY() - e1.getY()); 45 | if (Math.abs(dx) > dis && Math.abs(dy) < vDis) { 46 | if (velocityX > 0) { 47 | try { 48 | int pos = pointToPosition((int) e1.getX(), (int) e1.getY()); 49 | if (pos != -1 && _onSwipeRight != null) 50 | _onSwipeRight.onSwipe(pos, e1.getX(), e1.getY()); 51 | } catch (Exception e) { 52 | e.printStackTrace(); 53 | } 54 | } 55 | } 56 | return true; 57 | } 58 | }); 59 | } 60 | 61 | @Override 62 | public boolean dispatchTouchEvent(MotionEvent ev) { 63 | _gestureDetector.onTouchEvent(ev); 64 | return super.dispatchTouchEvent(ev); 65 | } 66 | 67 | public interface OnSwipeRight { 68 | void onSwipe(int pos, float x, float y); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/widget/NavigationView.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.widget; 2 | 3 | import android.content.Context; 4 | import android.os.Build; 5 | import android.util.AttributeSet; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.view.WindowInsets; 9 | 10 | public class NavigationView extends View { 11 | public NavigationView(Context context, AttributeSet attr) { 12 | super(context, attr); 13 | } 14 | 15 | public void onLayout(boolean changed, int left, int top, int right, int bottom) { 16 | // scale the view to pad the home layout for the missing status and navigation bars 17 | // TODO move home layout to class so this can be done within the view itself 18 | } 19 | 20 | @Override 21 | public WindowInsets onApplyWindowInsets(WindowInsets insets) { 22 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) { 23 | int inset = insets.getSystemWindowInsetBottom(); 24 | if (inset != 0) { 25 | ViewGroup.LayoutParams layoutParams = getLayoutParams(); 26 | layoutParams.height = inset; 27 | setLayoutParams(layoutParams); 28 | setVisibility(VISIBLE); 29 | } 30 | } 31 | return insets; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/widget/StatusView.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.widget; 2 | 3 | import android.content.Context; 4 | import android.os.Build; 5 | import android.util.AttributeSet; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.view.WindowInsets; 9 | 10 | public class StatusView extends View { 11 | public StatusView(Context context, AttributeSet attr) { 12 | super(context, attr); 13 | } 14 | 15 | public void onLayout(boolean changed, int left, int top, int right, int bottom) { 16 | // scale the view to pad the home layout for the missing status and navigation bars 17 | // TODO move home layout to class so this can be done within the view itself 18 | } 19 | 20 | @Override 21 | public WindowInsets onApplyWindowInsets(WindowInsets insets) { 22 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) { 23 | int inset = insets.getSystemWindowInsetTop(); 24 | if (inset != 0) { 25 | ViewGroup.LayoutParams layoutParams = getLayoutParams(); 26 | layoutParams.height = inset; 27 | setLayoutParams(layoutParams); 28 | setVisibility(VISIBLE); 29 | } 30 | } 31 | return insets; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/benny/openlauncher/widget/WidgetView.java: -------------------------------------------------------------------------------- 1 | package com.benny.openlauncher.widget; 2 | 3 | import android.appwidget.AppWidgetHostView; 4 | import android.content.Context; 5 | import android.view.MotionEvent; 6 | 7 | public class WidgetView extends AppWidgetHostView { 8 | private OnTouchListener _onTouchListener; 9 | private OnLongClickListener _longClick; 10 | private long _down; 11 | 12 | public WidgetView(Context context) { 13 | super(context); 14 | setLongClickable(true); 15 | } 16 | 17 | @Override 18 | public void setOnTouchListener(OnTouchListener onTouchListener) { 19 | _onTouchListener = onTouchListener; 20 | } 21 | 22 | @Override 23 | public void setOnLongClickListener(OnLongClickListener l) { 24 | _longClick = l; 25 | } 26 | 27 | @Override 28 | public boolean onInterceptTouchEvent(MotionEvent ev) { 29 | if (_onTouchListener != null) { 30 | _onTouchListener.onTouch(this, ev); 31 | } 32 | 33 | switch (ev.getActionMasked()) { 34 | case MotionEvent.ACTION_DOWN: 35 | _down = System.currentTimeMillis(); 36 | break; 37 | case MotionEvent.ACTION_MOVE: 38 | long delta = System.currentTimeMillis() - _down; 39 | if (delta > 300L) { 40 | _longClick.onLongClick(this); 41 | } 42 | break; 43 | } 44 | 45 | return false; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/flask/colorpicker/ColorCircle.java: -------------------------------------------------------------------------------- 1 | package com.flask.colorpicker; 2 | 3 | import android.graphics.Color; 4 | 5 | public class ColorCircle { 6 | private float x, y; 7 | private float[] hsv = new float[3]; 8 | private float[] hsvClone; 9 | private int color; 10 | 11 | public ColorCircle(float x, float y, float[] hsv) { 12 | set(x, y, hsv); 13 | } 14 | 15 | public double sqDist(float x, float y) { 16 | double dx = this.x - x; 17 | double dy = this.y - y; 18 | return dx * dx + dy * dy; 19 | } 20 | 21 | public float getX() { 22 | return x; 23 | } 24 | 25 | public float getY() { 26 | return y; 27 | } 28 | 29 | public float[] getHsv() { 30 | return hsv; 31 | } 32 | 33 | public float[] getHsvWithLightness(float lightness) { 34 | if (hsvClone == null) 35 | hsvClone = hsv.clone(); 36 | hsvClone[0] = hsv[0]; 37 | hsvClone[1] = hsv[1]; 38 | hsvClone[2] = lightness; 39 | return hsvClone; 40 | } 41 | 42 | public void set(float x, float y, float[] hsv) { 43 | this.x = x; 44 | this.y = y; 45 | this.hsv[0] = hsv[0]; 46 | this.hsv[1] = hsv[1]; 47 | this.hsv[2] = hsv[2]; 48 | this.color = Color.HSVToColor(this.hsv); 49 | } 50 | 51 | public int getColor() { 52 | return color; 53 | } 54 | } -------------------------------------------------------------------------------- /app/src/main/java/com/flask/colorpicker/ColorCircleDrawable.java: -------------------------------------------------------------------------------- 1 | package com.flask.colorpicker; 2 | 3 | import android.graphics.Canvas; 4 | import android.graphics.Paint; 5 | import android.graphics.drawable.ColorDrawable; 6 | 7 | import com.flask.colorpicker.builder.PaintBuilder; 8 | 9 | public class ColorCircleDrawable extends ColorDrawable { 10 | private float strokeWidth; 11 | private Paint strokePaint = PaintBuilder.newPaint().style(Paint.Style.STROKE).stroke(strokeWidth).color(0xff9e9e9e).build(); 12 | private Paint fillPaint = PaintBuilder.newPaint().style(Paint.Style.FILL).color(0).build(); 13 | private Paint fillBackPaint = PaintBuilder.newPaint().shader(PaintBuilder.createAlphaPatternShader(26)).build(); 14 | 15 | public ColorCircleDrawable(int color) { 16 | super(color); 17 | } 18 | 19 | @Override 20 | public void draw(Canvas canvas) { 21 | canvas.drawColor(0); 22 | 23 | int width = canvas.getWidth(); 24 | float radius = width / 2f; 25 | strokeWidth = radius / 8f; 26 | 27 | this.strokePaint.setStrokeWidth(strokeWidth); 28 | this.fillPaint.setColor(getColor()); 29 | canvas.drawCircle(radius, radius, radius - strokeWidth, fillBackPaint); 30 | canvas.drawCircle(radius, radius, radius - strokeWidth, fillPaint); 31 | canvas.drawCircle(radius, radius, radius - strokeWidth, strokePaint); 32 | } 33 | 34 | @Override 35 | public void setColor(int color) { 36 | super.setColor(color); 37 | invalidateSelf(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/flask/colorpicker/OnColorChangedListener.java: -------------------------------------------------------------------------------- 1 | package com.flask.colorpicker; 2 | 3 | public interface OnColorChangedListener { 4 | void onColorChanged(int selectedColor); 5 | } 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/flask/colorpicker/OnColorSelectedListener.java: -------------------------------------------------------------------------------- 1 | package com.flask.colorpicker; 2 | 3 | public interface OnColorSelectedListener { 4 | void onColorSelected(int selectedColor); 5 | } 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/flask/colorpicker/Utils.java: -------------------------------------------------------------------------------- 1 | package com.flask.colorpicker; 2 | 3 | import android.graphics.Color; 4 | 5 | /** 6 | * Created by Charles Andersons on 4/17/15. 7 | */ 8 | public class Utils { 9 | public static float getAlphaPercent(int argb) { 10 | return Color.alpha(argb) / 255f; 11 | } 12 | 13 | public static int alphaValueAsInt(float alpha) { 14 | return Math.round(alpha * 255); 15 | } 16 | 17 | public static int adjustAlpha(float alpha, int color) { 18 | return alphaValueAsInt(alpha) << 24 | (0x00ffffff & color); 19 | } 20 | 21 | public static int colorAtLightness(int color, float lightness) { 22 | float[] hsv = new float[3]; 23 | Color.colorToHSV(color, hsv); 24 | hsv[2] = lightness; 25 | return Color.HSVToColor(hsv); 26 | } 27 | 28 | public static float lightnessOfColor(int color) { 29 | float[] hsv = new float[3]; 30 | Color.colorToHSV(color, hsv); 31 | return hsv[2]; 32 | } 33 | 34 | public static String getHexString(int color, boolean showAlpha) { 35 | int base = showAlpha ? 0xFFFFFFFF : 0xFFFFFF; 36 | String format = showAlpha ? "#%08X" : "#%06X"; 37 | return String.format(format, (base & color)).toUpperCase(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/com/flask/colorpicker/builder/ColorPickerClickListener.java: -------------------------------------------------------------------------------- 1 | package com.flask.colorpicker.builder; 2 | 3 | import android.content.DialogInterface; 4 | 5 | /** 6 | * Created by Charles Anderson on 4/17/15. 7 | */ 8 | public interface ColorPickerClickListener { 9 | void onClick(DialogInterface d, int lastSelectedColor, Integer[] allColors); 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/flask/colorpicker/builder/ColorWheelRendererBuilder.java: -------------------------------------------------------------------------------- 1 | package com.flask.colorpicker.builder; 2 | 3 | import com.flask.colorpicker.ColorPickerView; 4 | import com.flask.colorpicker.renderer.ColorWheelRenderer; 5 | import com.flask.colorpicker.renderer.FlowerColorWheelRenderer; 6 | import com.flask.colorpicker.renderer.SimpleColorWheelRenderer; 7 | 8 | public class ColorWheelRendererBuilder { 9 | public static ColorWheelRenderer getRenderer(ColorPickerView.WHEEL_TYPE wheelType) { 10 | switch (wheelType) { 11 | case CIRCLE: 12 | return new SimpleColorWheelRenderer(); 13 | case FLOWER: 14 | return new FlowerColorWheelRenderer(); 15 | } 16 | throw new IllegalArgumentException("wrong WHEEL_TYPE"); 17 | } 18 | } -------------------------------------------------------------------------------- /app/src/main/java/com/flask/colorpicker/builder/PaintBuilder.java: -------------------------------------------------------------------------------- 1 | package com.flask.colorpicker.builder; 2 | 3 | import android.graphics.Bitmap; 4 | import android.graphics.BitmapShader; 5 | import android.graphics.Canvas; 6 | import android.graphics.Paint; 7 | import android.graphics.PorterDuff; 8 | import android.graphics.PorterDuffXfermode; 9 | import android.graphics.Shader; 10 | 11 | public class PaintBuilder { 12 | public static PaintHolder newPaint() { 13 | return new PaintHolder(); 14 | } 15 | 16 | public static class PaintHolder { 17 | private Paint paint; 18 | 19 | private PaintHolder() { 20 | this.paint = new Paint(Paint.ANTI_ALIAS_FLAG); 21 | } 22 | 23 | public PaintHolder color(int color) { 24 | this.paint.setColor(color); 25 | return this; 26 | } 27 | 28 | public PaintHolder antiAlias(boolean flag) { 29 | this.paint.setAntiAlias(flag); 30 | return this; 31 | } 32 | 33 | public PaintHolder style(Paint.Style style) { 34 | this.paint.setStyle(style); 35 | return this; 36 | } 37 | 38 | public PaintHolder mode(PorterDuff.Mode mode) { 39 | this.paint.setXfermode(new PorterDuffXfermode(mode)); 40 | return this; 41 | } 42 | 43 | public PaintHolder stroke(float width) { 44 | this.paint.setStrokeWidth(width); 45 | return this; 46 | } 47 | 48 | public PaintHolder xPerMode(PorterDuff.Mode mode) { 49 | this.paint.setXfermode(new PorterDuffXfermode(mode)); 50 | return this; 51 | } 52 | 53 | public PaintHolder shader(Shader shader) { 54 | this.paint.setShader(shader); 55 | return this; 56 | } 57 | 58 | public Paint build() { 59 | return this.paint; 60 | } 61 | } 62 | 63 | public static Shader createAlphaPatternShader(int size) { 64 | size /= 2; 65 | size = Math.max(8, size * 2); 66 | return new BitmapShader(createAlphaBackgroundPattern(size), Shader.TileMode.REPEAT, Shader.TileMode.REPEAT); 67 | } 68 | 69 | private static Bitmap createAlphaBackgroundPattern(int size) { 70 | Paint alphaPatternPaint = PaintBuilder.newPaint().build(); 71 | Bitmap bm = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888); 72 | Canvas c = new Canvas(bm); 73 | int s = Math.round(size / 2f); 74 | for (int i = 0; i < 2; i++) 75 | for (int j = 0; j < 2; j++) { 76 | if ((i + j) % 2 == 0) alphaPatternPaint.setColor(0xffffffff); 77 | else alphaPatternPaint.setColor(0xffd0d0d0); 78 | c.drawRect(i * s, j * s, (i + 1) * s, (j + 1) * s, alphaPatternPaint); 79 | } 80 | return bm; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /app/src/main/java/com/flask/colorpicker/renderer/AbsColorWheelRenderer.java: -------------------------------------------------------------------------------- 1 | package com.flask.colorpicker.renderer; 2 | 3 | import com.flask.colorpicker.ColorCircle; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | public abstract class AbsColorWheelRenderer implements ColorWheelRenderer { 9 | protected ColorWheelRenderOption colorWheelRenderOption; 10 | protected List colorCircleList = new ArrayList<>(); 11 | 12 | public void initWith(ColorWheelRenderOption colorWheelRenderOption) { 13 | this.colorWheelRenderOption = colorWheelRenderOption; 14 | this.colorCircleList.clear(); 15 | } 16 | 17 | @Override 18 | public ColorWheelRenderOption getRenderOption() { 19 | if (colorWheelRenderOption == null) colorWheelRenderOption = new ColorWheelRenderOption(); 20 | return colorWheelRenderOption; 21 | } 22 | 23 | public List getColorCircleList() { 24 | return colorCircleList; 25 | } 26 | 27 | protected int getAlphaValueAsInt() { 28 | return Math.round(colorWheelRenderOption.alpha * 255); 29 | } 30 | 31 | protected int calcTotalCount(float radius, float size) { 32 | return Math.max(1, (int) ((1f - GAP_PERCENTAGE) * Math.PI / (Math.asin(size / radius)) + 0.5f)); 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/main/java/com/flask/colorpicker/renderer/ColorWheelRenderOption.java: -------------------------------------------------------------------------------- 1 | package com.flask.colorpicker.renderer; 2 | 3 | import android.graphics.Canvas; 4 | 5 | public class ColorWheelRenderOption { 6 | public int density; 7 | public float maxRadius; 8 | public float cSize, strokeWidth, alpha, lightness; 9 | public Canvas targetCanvas; 10 | } -------------------------------------------------------------------------------- /app/src/main/java/com/flask/colorpicker/renderer/ColorWheelRenderer.java: -------------------------------------------------------------------------------- 1 | package com.flask.colorpicker.renderer; 2 | 3 | import com.flask.colorpicker.ColorCircle; 4 | 5 | import java.util.List; 6 | 7 | public interface ColorWheelRenderer { 8 | float GAP_PERCENTAGE = 0.025f; 9 | 10 | void draw(); 11 | 12 | ColorWheelRenderOption getRenderOption(); 13 | 14 | void initWith(ColorWheelRenderOption colorWheelRenderOption); 15 | 16 | List getColorCircleList(); 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/flask/colorpicker/renderer/FlowerColorWheelRenderer.java: -------------------------------------------------------------------------------- 1 | package com.flask.colorpicker.renderer; 2 | 3 | import android.graphics.Color; 4 | import android.graphics.Paint; 5 | 6 | import com.flask.colorpicker.ColorCircle; 7 | import com.flask.colorpicker.builder.PaintBuilder; 8 | 9 | public class FlowerColorWheelRenderer extends AbsColorWheelRenderer { 10 | private Paint selectorFill = PaintBuilder.newPaint().build(); 11 | private float[] hsv = new float[3]; 12 | private float sizeJitter = 1.2f; 13 | 14 | @Override 15 | public void draw() { 16 | final int setSize = colorCircleList.size(); 17 | int currentCount = 0; 18 | float half = colorWheelRenderOption.targetCanvas.getWidth() / 2f; 19 | int density = colorWheelRenderOption.density; 20 | float strokeWidth = colorWheelRenderOption.strokeWidth; 21 | float maxRadius = colorWheelRenderOption.maxRadius; 22 | float cSize = colorWheelRenderOption.cSize; 23 | 24 | for (int i = 0; i < density; i++) { 25 | float p = (float) i / (density - 1); // 0~1 26 | float jitter = (i - density / 2f) / density; // -0.5 ~ 0.5 27 | float radius = maxRadius * p; 28 | float size = Math.max(1.5f + strokeWidth, cSize + (i == 0 ? 0 : cSize * sizeJitter * jitter)); 29 | int total = Math.min(calcTotalCount(radius, size), density * 2); 30 | 31 | for (int j = 0; j < total; j++) { 32 | double angle = Math.PI * 2 * j / total + (Math.PI / total) * ((i + 1) % 2); 33 | float x = half + (float) (radius * Math.cos(angle)); 34 | float y = half + (float) (radius * Math.sin(angle)); 35 | hsv[0] = (float) (angle * 180 / Math.PI); 36 | hsv[1] = radius / maxRadius; 37 | hsv[2] = colorWheelRenderOption.lightness; 38 | selectorFill.setColor(Color.HSVToColor(hsv)); 39 | selectorFill.setAlpha(getAlphaValueAsInt()); 40 | 41 | colorWheelRenderOption.targetCanvas.drawCircle(x, y, size - strokeWidth, selectorFill); 42 | 43 | if (currentCount >= setSize) { 44 | colorCircleList.add(new ColorCircle(x, y, hsv)); 45 | } else colorCircleList.get(currentCount).set(x, y, hsv); 46 | currentCount++; 47 | } 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /app/src/main/java/com/flask/colorpicker/renderer/SimpleColorWheelRenderer.java: -------------------------------------------------------------------------------- 1 | package com.flask.colorpicker.renderer; 2 | 3 | import android.graphics.Color; 4 | import android.graphics.Paint; 5 | 6 | import com.flask.colorpicker.ColorCircle; 7 | import com.flask.colorpicker.builder.PaintBuilder; 8 | 9 | public class SimpleColorWheelRenderer extends AbsColorWheelRenderer { 10 | private Paint selectorFill = PaintBuilder.newPaint().build(); 11 | private float[] hsv = new float[3]; 12 | 13 | @Override 14 | public void draw() { 15 | final int setSize = colorCircleList.size(); 16 | int currentCount = 0; 17 | float half = colorWheelRenderOption.targetCanvas.getWidth() / 2f; 18 | int density = colorWheelRenderOption.density; 19 | float maxRadius = colorWheelRenderOption.maxRadius; 20 | 21 | for (int i = 0; i < density; i++) { 22 | float p = (float) i / (density - 1); // 0~1 23 | float radius = maxRadius * p; 24 | float size = colorWheelRenderOption.cSize; 25 | int total = calcTotalCount(radius, size); 26 | 27 | for (int j = 0; j < total; j++) { 28 | double angle = Math.PI * 2 * j / total + (Math.PI / total) * ((i + 1) % 2); 29 | float x = half + (float) (radius * Math.cos(angle)); 30 | float y = half + (float) (radius * Math.sin(angle)); 31 | hsv[0] = (float) (angle * 180 / Math.PI); 32 | hsv[1] = radius / maxRadius; 33 | hsv[2] = colorWheelRenderOption.lightness; 34 | selectorFill.setColor(Color.HSVToColor(hsv)); 35 | selectorFill.setAlpha(getAlphaValueAsInt()); 36 | 37 | colorWheelRenderOption.targetCanvas.drawCircle(x, y, size - colorWheelRenderOption.strokeWidth, selectorFill); 38 | 39 | if (currentCount >= setSize) 40 | colorCircleList.add(new ColorCircle(x, y, hsv)); 41 | else colorCircleList.get(currentCount).set(x, y, hsv); 42 | currentCount++; 43 | } 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /app/src/main/java/com/flask/colorpicker/slider/LightnessSlider.java: -------------------------------------------------------------------------------- 1 | package com.flask.colorpicker.slider; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.graphics.Color; 6 | import android.graphics.Paint; 7 | import android.graphics.PorterDuff; 8 | import android.util.AttributeSet; 9 | 10 | import com.flask.colorpicker.ColorPickerView; 11 | import com.flask.colorpicker.Utils; 12 | import com.flask.colorpicker.builder.PaintBuilder; 13 | 14 | public class LightnessSlider extends AbsCustomSlider { 15 | private int color; 16 | private Paint barPaint = PaintBuilder.newPaint().build(); 17 | private Paint solid = PaintBuilder.newPaint().build(); 18 | private Paint clearingStroke = PaintBuilder.newPaint().color(0xffffffff).xPerMode(PorterDuff.Mode.CLEAR).build(); 19 | 20 | private ColorPickerView colorPicker; 21 | 22 | public LightnessSlider(Context context) { 23 | super(context); 24 | } 25 | 26 | public LightnessSlider(Context context, AttributeSet attrs) { 27 | super(context, attrs); 28 | } 29 | 30 | public LightnessSlider(Context context, AttributeSet attrs, int defStyleAttr) { 31 | super(context, attrs, defStyleAttr); 32 | } 33 | 34 | @Override 35 | protected void drawBar(Canvas barCanvas) { 36 | int width = barCanvas.getWidth(); 37 | int height = barCanvas.getHeight(); 38 | 39 | float[] hsv = new float[3]; 40 | Color.colorToHSV(color, hsv); 41 | int l = Math.max(2, width / 256); 42 | for (int x = 0; x <= width; x += l) { 43 | hsv[2] = (float) x / (width - 1); 44 | barPaint.setColor(Color.HSVToColor(hsv)); 45 | barCanvas.drawRect(x, 0, x + l, height, barPaint); 46 | } 47 | } 48 | 49 | @Override 50 | protected void onValueChanged(float value) { 51 | if (colorPicker != null) 52 | colorPicker.setLightness(value); 53 | } 54 | 55 | @Override 56 | protected void drawHandle(Canvas canvas, float x, float y) { 57 | solid.setColor(Utils.colorAtLightness(color, value)); 58 | if (showBorder) canvas.drawCircle(x, y, handleRadius, clearingStroke); 59 | canvas.drawCircle(x, y, handleRadius * 0.75f, solid); 60 | } 61 | 62 | public void setColorPicker(ColorPickerView colorPicker) { 63 | this.colorPicker = colorPicker; 64 | } 65 | 66 | public void setColor(int color) { 67 | this.color = color; 68 | this.value = Utils.lightnessOfColor(color); 69 | if (bar != null) { 70 | updateBar(); 71 | invalidate(); 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /app/src/main/java/com/flask/colorpicker/slider/OnValueChangedListener.java: -------------------------------------------------------------------------------- 1 | package com.flask.colorpicker.slider; 2 | 3 | public interface OnValueChangedListener { 4 | void onValueChanged(float value); 5 | } -------------------------------------------------------------------------------- /app/src/main/java/net/gsantner/opoc/preference/PropertyBackend.java: -------------------------------------------------------------------------------- 1 | /*####################################################### 2 | * 3 | * Maintained 2018-2023 by Gregor Santner 4 | * 5 | * License: Apache 2.0 6 | * https://github.com/gsantner/opoc/#licensing 7 | * https://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | #########################################################*/ 10 | package net.gsantner.opoc.preference; 11 | 12 | import java.util.List; 13 | 14 | @SuppressWarnings({"UnusedReturnValue", "SpellCheckingInspection", "unused", "SameParameterValue"}) 15 | public interface PropertyBackend { 16 | String getString(TKEY key, String defaultValue); 17 | 18 | int getInt(TKEY key, int defaultValue); 19 | 20 | long getLong(TKEY key, long defaultValue); 21 | 22 | boolean getBool(TKEY key, boolean defaultValue); 23 | 24 | float getFloat(TKEY key, float defaultValue); 25 | 26 | double getDouble(TKEY key, double defaultValue); 27 | 28 | List getIntList(TKEY key); 29 | 30 | List getStringList(TKEY key); 31 | 32 | TTHIS setString(TKEY key, String value); 33 | 34 | TTHIS setInt(TKEY key, int value); 35 | 36 | TTHIS setLong(TKEY key, long value); 37 | 38 | TTHIS setBool(TKEY key, boolean value); 39 | 40 | TTHIS setFloat(TKEY key, float value); 41 | 42 | TTHIS setDouble(TKEY key, double value); 43 | 44 | TTHIS setIntList(TKEY key, List value); 45 | 46 | TTHIS setStringList(TKEY key, List value); 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/net/gsantner/opoc/util/Callback.java: -------------------------------------------------------------------------------- 1 | /*####################################################### 2 | * 3 | * Maintained 2018-2023 by Gregor Santner 4 | * 5 | * License of this file: Apache 2.0 6 | * https://www.apache.org/licenses/LICENSE-2.0 7 | * https://github.com/gsantner/opoc/#licensing 8 | * 9 | #########################################################*/ 10 | package net.gsantner.opoc.util; 11 | 12 | @SuppressWarnings("unused") 13 | public class Callback { 14 | 15 | public interface a0 { 16 | void callback(); 17 | } 18 | 19 | public interface a1 { 20 | void callback(A arg1); 21 | } 22 | 23 | public interface a2 { 24 | void callback(A arg1, B arg2); 25 | } 26 | 27 | public interface a3 { 28 | void callback(A arg1, B arg2, C arg3); 29 | } 30 | 31 | public interface a4 { 32 | void callback(A arg1, B arg2, C arg3, D arg4); 33 | } 34 | 35 | public interface a5 { 36 | void callback(A arg1, B arg2, C arg3, D arg4, E arg5); 37 | } 38 | 39 | public interface b0 { 40 | boolean callback(); 41 | } 42 | 43 | public interface b1 { 44 | boolean callback(A arg1); 45 | } 46 | 47 | public interface b2 { 48 | boolean callback(A arg1, B arg2); 49 | } 50 | 51 | public interface b3 { 52 | boolean callback(A arg1, B arg2, C arg3); 53 | } 54 | 55 | public interface b4 { 56 | boolean callback(A arg1, B arg2, C arg3, D arg4); 57 | } 58 | 59 | public interface b5 { 60 | boolean callback(A arg1, B arg2, C arg3, D arg4, E arg5); 61 | } 62 | 63 | public interface s0 { 64 | String callback(); 65 | } 66 | 67 | public interface s1 { 68 | String callback(A arg1); 69 | } 70 | 71 | public interface s2 { 72 | String callback(A arg1, B arg2); 73 | } 74 | 75 | public interface s3 { 76 | String callback(A arg1, B arg2, C arg3); 77 | } 78 | 79 | public interface s4 { 80 | String callback(A arg1, B arg2, C arg3, D arg4); 81 | } 82 | 83 | public interface s5 { 84 | String callback(A arg1, B arg2, C arg3, D arg4, E arg5); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /app/src/main/java/net/gsantner/opoc/util/PermissionChecker.java: -------------------------------------------------------------------------------- 1 | /*####################################################### 2 | * 3 | * Maintained 2017-2023 by Gregor Santner 4 | * 5 | * License of this file: Apache 2.0 6 | * https://www.apache.org/licenses/LICENSE-2.0 7 | * https://github.com/gsantner/opoc/#licensing 8 | * 9 | #########################################################*/ 10 | package net.gsantner.opoc.util; 11 | 12 | import android.Manifest; 13 | import android.app.Activity; 14 | import android.content.pm.PackageManager; 15 | import android.support.v4.app.ActivityCompat; 16 | import android.support.v4.content.ContextCompat; 17 | import android.support.v7.app.AlertDialog; 18 | 19 | import java.io.File; 20 | 21 | @SuppressWarnings({"unused", "WeakerAccess"}) 22 | public class PermissionChecker { 23 | protected static final int CODE_PERMISSION_EXTERNAL_STORAGE = 4000; 24 | 25 | protected Activity _activity; 26 | 27 | public PermissionChecker(Activity activity) { 28 | _activity = activity; 29 | } 30 | 31 | public boolean doIfExtStoragePermissionGranted(String... optionalToastMessageForKnowingWhyNeeded) { 32 | if (ContextCompat.checkSelfPermission(_activity, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { 33 | 34 | if (optionalToastMessageForKnowingWhyNeeded != null && optionalToastMessageForKnowingWhyNeeded.length > 0 && optionalToastMessageForKnowingWhyNeeded[0] != null) { 35 | new AlertDialog.Builder(_activity) 36 | .setMessage(optionalToastMessageForKnowingWhyNeeded[0]) 37 | .setCancelable(false) 38 | .setNegativeButton(android.R.string.no, null) 39 | .setPositiveButton(android.R.string.yes, (dialog, which) -> { 40 | if (android.os.Build.VERSION.SDK_INT >= 23) { 41 | ActivityCompat.requestPermissions(_activity, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, CODE_PERMISSION_EXTERNAL_STORAGE); 42 | } 43 | }) 44 | .show(); 45 | return false; 46 | } 47 | ActivityCompat.requestPermissions(_activity, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, CODE_PERMISSION_EXTERNAL_STORAGE); 48 | return false; 49 | } 50 | return true; 51 | } 52 | 53 | public boolean checkPermissionResult(int requestCode, String[] permissions, int[] grantResults) { 54 | if (grantResults.length > 0) { 55 | switch (requestCode) { 56 | case CODE_PERMISSION_EXTERNAL_STORAGE: { 57 | if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { 58 | return true; 59 | } 60 | } 61 | } 62 | } 63 | return false; 64 | } 65 | 66 | public boolean mkdirIfStoragePermissionGranted(File dir) { 67 | return doIfExtStoragePermissionGranted() && (dir.exists() || dir.mkdirs()); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/intro_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/app/src/main/res/drawable-nodpi/intro_2.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/intro_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/app/src/main/res/drawable-nodpi/intro_3.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/intro_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/app/src/main/res/drawable-nodpi/intro_4.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_android.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | 18 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_apps.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_arrow_back_white.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_behavior.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_bug.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_camera_.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_check_dark.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_check_white.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_clear.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_close.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_code.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_copyright.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_dashboard.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_delete.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_desktop.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_dock.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_edit.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_expand.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_favorite.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_group.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_hide_apps.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_info.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launch.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_lock.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_lock_open.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_minibar.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_network.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_notifications.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_palette.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_person.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_photo.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_resize.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_search.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_settings.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_star.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_star_border.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_thumb_up.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_translate.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_view_grid_white.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_view_list_white.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_visibility.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_volume.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/item_drawer.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/new_page.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | 8 | 9 | 12 | 13 | 14 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ol_loading_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ol_loading_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ol_loading_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/scale_widget.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_hide_apps.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_home.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 9 | 10 | 11 | 12 | 18 | 19 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_minibar_edit.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 14 | 15 | 20 | 21 | 30 | 31 | 32 | 33 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_more.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/layout/color_edit.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/layout/color_preview.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/layout/color_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/color_widget.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_app.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_edit_minibar.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 20 | 21 | 31 | 32 | 37 | 38 | 45 | 46 | 47 | 48 | 57 | 58 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_hide_apps.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 19 | 20 | 24 | 25 | 32 | 33 | 39 | 40 | 41 | 46 | 47 | 60 | 61 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_icon_label.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_minibar.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 15 | 16 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_popup_icon_label.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 23 | 24 | 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/res/layout/toolbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/view_app_drawer_grid.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/view_app_drawer_page.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/layout/view_app_drawer_page_inner.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 13 | 14 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/view_drag_option.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 17 | 18 | 27 | 28 | 37 | 38 | 47 | 48 | -------------------------------------------------------------------------------- /app/src/main/res/layout/view_drawer_indicator.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/layout/view_group_popup.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 22 | 23 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/layout/view_hide_apps.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 15 | 16 | 28 | 29 | 37 | 38 | 39 | 40 | 46 | 47 | 48 | 49 | 57 | 58 | -------------------------------------------------------------------------------- /app/src/main/res/layout/view_search_clock.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/view_widget_container.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 16 | 17 | 28 | 29 | 40 | 41 | 52 | 53 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/raw/licenses.md: -------------------------------------------------------------------------------- 1 | ## The MIT License (MIT) 2 | * **CircularReveal** 3 | ~° Copyright (c) Abdullaev Ozodrukh 4 | ~° https://github.com/ozodrukh/CircularReveal 5 | 6 | * **Material Dialogs** 7 | ~° Copyright (c) Aidan Follestad 8 | ~° https://github.com/afollestad/material-dialogs 9 | 10 | * **TextDrawable** 11 | ~° Copyright (c) Amulya Khare 12 | ~° https://github.com/amulyakhare/TextDrawable 13 | 14 | `---------------` 15 | Permission is hereby granted, free of charge, to any person obtaining a copy 16 | of this software and associated documentation files (the "Software"), to deal 17 | in the Software without restriction, including without limitation the rights 18 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 19 | copies of the Software, and to permit persons to whom the Software is 20 | furnished to do so, subject to the following conditions: 21 | 22 | The above copyright notice and this permission notice shall be included in all 23 | copies or substantial portions of the Software. 24 | 25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 27 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 28 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 29 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 30 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 31 | SOFTWARE. 32 | `---------------` 33 | 34 | 35 | ## Apache License 36 | Version 2.0, January 2004 37 | 38 | * **FastAdaptern** 39 | ~° Copyright (c) Mike Penz 40 | ~° https://github.com/mikepenz/FastAdapter 41 | 42 | * **Butterknife** 43 | ~° Copyright (c) 2013 Jake Wharton 44 | ~° https://github.com/JakeWharton/butterknife 45 | 46 | * **MaterialScrollBar** 47 | ~° Copyright (c) Turing Technologies 48 | ~° https://github.com/turing-tech/MaterialScrollBar 49 | 50 | * **Material Ripple Layout** 51 | ~° Copyright (c) Balys Valentukevicius 52 | ~° https://github.com/balysv/material-ripple 53 | 54 | * **ImageBlurring** 55 | ~° Copyright (c) Qiujuer 56 | ~° https://github.com/qiujuer/ImageBlurring 57 | 58 | * **SimpleFingerGestures** 59 | ~° Copyright (c) Arnav Gupta 60 | ~° https://github.com/championswimmer/SimpleFingerGestures_Android_Library 61 | 62 | * **AndroidOnboarder** 63 | ~° Copyright (c) Dzmitry Chyrta, Daniel Morales 64 | ~° https://github.com/chyrta/AndroidOnboarder 65 | 66 | * **CustomActivityOnCrash** 67 | ~° Copyright (c) Eduard Ereza Martínez 68 | ~° https://github.com/Ereza/CustomActivityOnCrash 69 | 70 | * **jaredrummler colorpicker** 71 | ~° Copyright (c) jaredrummler 72 | ~° https://github.com/jaredrummler/ColorPicker 73 | 74 | * **Android Support Library** 75 | ~° Copyright (c) The Android Open Source Project 76 | ~° https://developer.android.com/topic/libraries/support-library 77 | 78 | `---------------` 79 | Licensed under the Apache License, Version 2.0 (the "License"); 80 | you may not use this file except in compliance with the License. 81 | You may obtain a copy of the License at 82 | 83 | http://www.apache.org/licenses/LICENSE-2.0 84 | 85 | Unless required by applicable law or agreed to in writing, software 86 | distributed under the License is distributed on an "AS IS" BASIS, 87 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 88 | See the License for the specific language governing permissions and 89 | limitations under the License. 90 | `---------------` 91 | -------------------------------------------------------------------------------- /app/src/main/res/raw/project.md: -------------------------------------------------------------------------------- 1 | BennyKok 2 | Started OpenLauncher 3 | https://github.com/openlauncherteam/openlauncher 4 | 5 | Gregor Santner 6 | Austrian Software Developer 7 | https://github.com/gsantner 8 | 9 | dkanada 10 | Android Development 11 | https://github.com/dkanada 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/values-sw360dp-v13/values-preference.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | false 4 | 0dp 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | @string/none 6 | @string/action 7 | @string/app 8 | 9 | 10 | 11 | @string/minibar_title__edit_minibar 12 | @string/minibar_title__set_wallpaper 13 | @string/minibar_title__lock_screen 14 | @string/minibar_title__launcher_settings 15 | @string/minibar_title__volume_dialog 16 | @string/minibar_title__device_settings 17 | @string/minibar_title__app_drawer 18 | @string/minibar_title__search_bar 19 | @string/minibar_title__mobile_network 20 | @string/minibar_title__notification_bar 21 | 22 | 23 | 24 | @string/minibar_title__app_drawer 25 | 26 | 27 | 28 | @string/indicator_mode_dots 29 | @string/indicator_mode_lines 30 | 31 | 32 | 33 | @string/orientation_mode_portrait 34 | @string/orientation_mode_rotate 35 | @string/orientation_mode_landscape 36 | 37 | 38 | 39 | @string/scroll_normal 40 | @string/scroll_inverse 41 | @string/scroll_off 42 | 43 | 44 | 45 | @string/horizontal_paged_drawer 46 | @string/vertical_scroll_drawer 47 | 48 | 49 | 50 | @string/light 51 | @string/dark 52 | @string/black 53 | 54 | 55 | 56 | @string/custom 57 | February 17\nSaturday, 2018 58 | February 17\n15:48 59 | February 17, 2018\n15:48 60 | 15:48\nFebruary 17, 2018 61 | 62 | 63 | 64 | 0 65 | 1 66 | 67 | 68 | 69 | 0 70 | 1 71 | 2 72 | 73 | 74 | 75 | 0 76 | 1 77 | 2 78 | 3 79 | 4 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /app/src/main/res/values/color_attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/values/color_dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 36dp 3 | 24dp 4 | 4dp 5 | 10dp 6 | 24dp 7 | 40dp 8 | 36dp 9 | 20dp 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/color_styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #5c6bc0 4 | #4254b3 5 | #5c6bc0 6 | 7 | #f9f9f9 8 | #616161 9 | #9e9e9e 10 | 11 | #424242 12 | #ffffff 13 | #9e9e9e 14 | 15 | #000000 16 | 17 | #ffffff 18 | #000000 19 | #B0000000 20 | 21 | #d6552e 22 | #b4c64a 23 | #1892cc 24 | 25 | #ff444444 26 | #7d000000 27 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 4dp 3 | 8dp 4 | 16dp 5 | 6 | @dimen/default_margin_2 7 | 16dp 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/xml/device_admin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/xml/file_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/xml/preferences_advanced.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 13 | 14 | 18 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 32 | 33 | 37 | 38 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /app/src/main/res/xml/preferences_appearance.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | 22 | 23 | 24 | 25 | 32 | 33 | 37 | 38 | 39 | 40 | 41 | 42 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /app/src/main/res/xml/preferences_behavior.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 18 | 19 | 24 | 25 | 26 | 27 | 31 | 32 | 36 | 37 | 41 | 42 | 46 | 47 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /app/src/main/res/xml/preferences_dock.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 14 | 15 | 21 | 22 | 28 | 29 | 30 | 31 | 32 | 33 | 38 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /app/src/main/res/xml/preferences_master.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 14 | 15 | 20 | 21 | 26 | 27 | 32 | 33 | 34 | 35 | 36 | 37 | 42 | 43 | 48 | 49 | 53 | 54 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /assets/icon_nightly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/assets/icon_nightly.png -------------------------------------------------------------------------------- /assets/icon_stable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/assets/icon_stable.png -------------------------------------------------------------------------------- /assets/icon_test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/assets/icon_test.png -------------------------------------------------------------------------------- /assets/screenshots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenLauncherTeam/openlauncher/d86d23e14f8a045efad41fa5dd1de3c6250b4541/assets/screenshots.png -------------------------------------------------------------------------------- /fastlane/metadata/android/de/short_description.txt: -------------------------------------------------------------------------------- 1 | Starte Apps und verwalte den Homescreen -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/1.txt: -------------------------------------------------------------------------------- 1 | Initial Release 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/100.txt: -------------------------------------------------------------------------------- 1 | Release v1.0.0 2 | * Please see either of the links for changes in the v1.0.0 version: 3 | * https://github.com/OpenLauncherTeam/openlauncher/compare/v0.7.4...v1.0.0 4 | * https://github.com/OpenLauncherTeam/openlauncher/milestone/2?closed=1 5 | * https://github.com/OpenLauncherTeam/openlauncher/commits/master 6 | 7 | All the best, Gregor. 8 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/36.txt: -------------------------------------------------------------------------------- 1 | * fix gesture issues and redesign the selection dialog 2 | * backup and restore settings at a custom location 3 | * add new color picker preference 4 | * implement multiple rows for dock 5 | * fix several folder crashes 6 | * add preference for status and navigation bar color in desktop 7 | * add option to reset settings 8 | * slightly modify the look of line pager indicator 9 | * add black theme in the settings 10 | * center item arrangement in group drawables for two and three items 11 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/37.txt: -------------------------------------------------------------------------------- 1 | * add action to expand the notification bar 2 | * show summary for gesture preferences in settings 3 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/38.txt: -------------------------------------------------------------------------------- 1 | * add new wallpaper scrolling feature when swiping through pages 2 | * add setting for landscape mode on the desktop 3 | * add initial option for basic app notifications 4 | * improve pager indicator for desktop and app drawer views 5 | * improve interface for the hide apps activity 6 | * fix gesture feedback setting for newer devices 7 | * fix issues with icon projection while dragging items around 8 | * fix app uninstall for newer android devices 9 | * more string translations 10 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/39.txt: -------------------------------------------------------------------------------- 1 | Thanks: hobleyd, desempare, saechimdaeki 2 | 3 | * add wallpaper scroll setting with three different options 4 | * new action to open camera from gesture 5 | * refactor code for item and desktop options 6 | * fix issues with widget resize action 7 | * vibrate on desktop edit if gesture feedback is enabled 8 | * minor changes to folder colors 9 | * fix lots of issues with broken or missing widgets 10 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/40.txt: -------------------------------------------------------------------------------- 1 | * basic support for work profiles 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/41.txt: -------------------------------------------------------------------------------- 1 | Thanks: grenagit, hobleyd, r3r57 2 | 3 | * update french translations 4 | * fix issue with long click haptic feedback 5 | * notification icon improvements 6 | * lots of fixes for group items 7 | * reduce the number of crashes on the desktop 8 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/full_description.txt: -------------------------------------------------------------------------------- 1 | This is an open source launcher project for Android devices that has been built completely from scratch. The main goal of this launcher is to find a healthy balance between customization and unused features. If you would like to help out feel free to submit issues or submit a pull request. Jump on Stringlate or GitHub and translate this app to your native language, we will always accept community translations! 2 | 3 | Features 4 | 5 | * Paged desktop 6 | * Scrollable background 7 | * Paged app drawer 8 | * Vertical app drawer 9 | * Search bar 10 | * Custom icon packs 11 | 12 | Support the Project 13 | 14 | NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------