├── .gitignore
├── AndroidManifest.xml
├── README.md
├── ant.properties
├── libs
└── gson-2.2.2.jar
├── proguard-project.txt
├── project.properties
├── res
├── drawable-hdpi
│ ├── btn_default_disabled_focused_holo_light.9.png
│ ├── btn_default_disabled_holo_light.9.png
│ ├── btn_default_focused_holo_light.9.png
│ ├── btn_default_normal_holo_light.9.png
│ ├── btn_default_pressed_holo_light.9.png
│ ├── ic_action_add.png
│ ├── ic_action_add_grey.png
│ ├── ic_action_clear.png
│ ├── ic_action_clear_grey.png
│ ├── ic_action_clear_white.png
│ ├── ic_action_edit.png
│ ├── ic_action_edit_grey.png
│ ├── ic_action_globe.png
│ ├── ic_action_link.png
│ ├── ic_action_more.png
│ ├── ic_action_more_grey.png
│ ├── ic_action_more_white.png
│ ├── ic_action_settings.png
│ ├── ic_action_settings_grey.png
│ ├── ic_action_settings_white.png
│ ├── ic_action_trash.png
│ ├── ic_action_trash_grey.png
│ ├── ic_action_trash_white.png
│ ├── ic_launcher.png
│ ├── list_activated_holo.9.png
│ ├── list_focused_holo.9.png
│ ├── list_longpressed_holo.9.png
│ ├── list_pressed_holo_light.9.png
│ ├── list_selector_disabled_holo_light.9.png
│ ├── shortcut_icon.png
│ ├── textfield_activated_holo_light.9.png
│ ├── textfield_default_holo_light.9.png
│ ├── textfield_disabled_focused_holo_light.9.png
│ ├── textfield_disabled_holo_light.9.png
│ └── textfield_focused_holo_light.9.png
├── drawable-mdpi
│ ├── btn_default_disabled_focused_holo_light.9.png
│ ├── btn_default_disabled_holo_light.9.png
│ ├── btn_default_focused_holo_light.9.png
│ ├── btn_default_normal_holo_light.9.png
│ ├── btn_default_pressed_holo_light.9.png
│ ├── ic_action_add.png
│ ├── ic_action_add_grey.png
│ ├── ic_action_clear.png
│ ├── ic_action_clear_grey.png
│ ├── ic_action_clear_white.png
│ ├── ic_action_edit.png
│ ├── ic_action_edit_grey.png
│ ├── ic_action_globe.png
│ ├── ic_action_link.png
│ ├── ic_action_settings.png
│ ├── ic_action_settings_grey.png
│ ├── ic_action_settings_white.png
│ ├── ic_action_trash.png
│ ├── ic_action_trash_grey.png
│ ├── ic_action_trash_white.png
│ ├── ic_launcher.png
│ ├── list_activated_holo.9.png
│ ├── list_focused_holo.9.png
│ ├── list_longpressed_holo.9.png
│ ├── list_pressed_holo_light.9.png
│ ├── list_selector_disabled_holo_light.9.png
│ ├── shortcut_icon.png
│ ├── textfield_activated_holo_light.9.png
│ ├── textfield_default_holo_light.9.png
│ ├── textfield_disabled_focused_holo_light.9.png
│ ├── textfield_disabled_holo_light.9.png
│ └── textfield_focused_holo_light.9.png
├── drawable-xhdpi
│ ├── btn_default_disabled_focused_holo_light.9.png
│ ├── btn_default_disabled_holo_light.9.png
│ ├── btn_default_focused_holo_light.9.png
│ ├── btn_default_normal_holo_light.9.png
│ ├── btn_default_pressed_holo_light.9.png
│ ├── clear_data.png
│ ├── ic_action_add.png
│ ├── ic_action_add_grey.png
│ ├── ic_action_clear.png
│ ├── ic_action_clear_grey.png
│ ├── ic_action_clear_white.png
│ ├── ic_action_edit.png
│ ├── ic_action_edit_grey.png
│ ├── ic_action_globe.png
│ ├── ic_action_link.png
│ ├── ic_action_settings.png
│ ├── ic_action_settings_grey.png
│ ├── ic_action_settings_white.png
│ ├── ic_action_trash.png
│ ├── ic_action_trash_grey.png
│ ├── ic_action_trash_white.png
│ ├── ic_launcher.png
│ ├── list_activated_holo.9.png
│ ├── list_focused_holo.9.png
│ ├── list_longpressed_holo.9.png
│ ├── list_pressed_holo_light.9.png
│ ├── list_selector_disabled_holo_light.9.png
│ ├── shortcut_icon.png
│ ├── textfield_activated_holo_light.9.png
│ ├── textfield_default_holo_light.9.png
│ ├── textfield_disabled_focused_holo_light.9.png
│ ├── textfield_disabled_holo_light.9.png
│ └── textfield_focused_holo_light.9.png
├── drawable-xxhdpi
│ ├── ic_launcher.png
│ └── shortcut_icon.png
├── drawable
│ ├── add_imageview.xml
│ ├── background_repeat.xml
│ ├── background_repeat_dark.xml
│ ├── background_texture.png
│ ├── background_texture_dark.png
│ ├── btn_default_holo_light.xml
│ ├── clear_imageview.xml
│ ├── clear_imageview_dark.xml
│ ├── delete_imageview.xml
│ ├── delete_imageview_dark.xml
│ ├── devdrawer_widget_preview.png
│ ├── edit_imageview.xml
│ ├── edit_text_holo_light.xml
│ ├── list_selector_background_transition_holo_light.xml
│ ├── list_selector_holo_light.xml
│ ├── listview_button_background_normal.png
│ ├── listview_button_background_pressed.png
│ ├── listview_button_selector.xml
│ ├── more_imageview.xml
│ ├── more_imageview_dark.xml
│ ├── settings_imageview.xml
│ └── settings_imageview_dark.xml
├── layout-land
│ └── list_item_more.xml
├── layout-sw600dp
│ └── list_item_more.xml
├── layout
│ ├── activity_choice.xml
│ ├── activity_choice_list_item.xml
│ ├── custom_ab_title.xml
│ ├── dropdown_list_item.xml
│ ├── edit_dialog.xml
│ ├── legacy_dialog.xml
│ ├── list_item.xml
│ ├── list_item_more.xml
│ ├── list_item_more_legacy.xml
│ ├── locale_list_item.xml
│ ├── locale_switcher.xml
│ ├── main.xml
│ ├── package_list_item.xml
│ ├── widget_layout.xml
│ └── widget_layout_dark.xml
├── values-v11
│ ├── bools.xml
│ ├── devdrawertheme_styles.xml
│ └── devdrawertheme_themes.xml
├── values
│ ├── bools.xml
│ ├── colors.xml
│ ├── devdrawertheme_styles.xml
│ ├── devdrawertheme_themes.xml
│ └── strings.xml
└── xml
│ ├── preferences.xml
│ └── widget_info.xml
└── src
├── android
└── app
│ ├── ActivityManagerNative.java
│ └── IActivityManager.java
└── com
└── owentech
└── DevDrawer
├── activities
├── ChooseActivityDialog.java
├── ClickHandlingActivity.java
├── EditDialog.java
├── LegacyDialog.java
├── LocaleSwitcher.java
├── MainActivity.java
└── PrefActivity.java
├── adapters
├── ActivityListAdapter.java
├── FilterListAdapter.java
├── LegacyListAdapter.java
├── LocaleListAdapter.java
└── PartialMatchAdapter.java
├── appwidget
├── DDWidgetProvider.java
├── DDWidgetService.java
└── DDWidgetViewsFactory.java
├── receivers
├── AppInstalledReceiver.java
└── AppUninstalledReceiver.java
└── utils
├── AddAllAppsAsync.java
├── Constants.java
├── Database.java
├── PackageCollection.java
├── RootFeatures.java
└── RootLocaleSwitcher.java
/.gitignore:
--------------------------------------------------------------------------------
1 | # built application files
2 | *.apk
3 | *.ap_
4 |
5 | # files for the dex VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # generated files
12 | bin/
13 | gen/
14 |
15 | # Local configuration file (sdk path, etc)
16 | local.properties
17 |
18 | # Eclipse project files
19 | .classpath
20 | .project
21 | .settings
22 |
23 | # IntelliJ IDEA project files
24 | .idea
25 | *.iml
26 | *.eml
27 | classes
28 |
29 | # Command line
30 | build.xml
31 |
32 | # Mac specific
33 | .DS_Store
34 |
35 | # Sonar
36 | .sonar
37 |
38 | # ProGuard
39 | proguard_logs/dump.txt
40 | proguard_logs/seeds.txt
41 | proguard_logs/usage.txt
42 |
--------------------------------------------------------------------------------
/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
14 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
70 |
71 |
72 |
73 |
75 |
76 |
78 |
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # DevDrawer
2 |
3 | ** No longer maintained. Sorry I just don't have the time. **
4 | ** The code is disgusting in here, but if there's anything you want, feel free to take **
5 |
6 | An Android application by [Tony Owen](https://plus.google.com/111365666249481367719) designed to help developers by automatically adding their apps to a widget for easy launching / uninstalling / reinstalling etc.
7 |
8 | Root features such as one click uninstall, and clear cache added by [Ronald Ammann](https://plus.google.com/115926327659831685384/posts).
9 |
10 | This project needs a library dependency to [libsuperuser](https://github.com/Chainfire/libsuperuser).
11 |
12 | [Download DevDrawer in the Google Play Store](https://play.google.com/store/apps/details?id=com.owentech.DevDrawer).
13 |
--------------------------------------------------------------------------------
/ant.properties:
--------------------------------------------------------------------------------
1 | # This file is used to override default values used by the Ant build system.
2 | #
3 | # This file must be checked into Version Control Systems, as it is
4 | # integral to the build system of your project.
5 |
6 | # This file is only used by the Ant script.
7 |
8 | # You can use this to override default values such as
9 | # 'source.dir' for the location of your java source folder and
10 | # 'out.dir' for the location of your output folder.
11 |
12 | # You can also use it define how the release builds are signed by declaring
13 | # the following properties:
14 | # 'key.store' for the location of your keystore and
15 | # 'key.alias' for the name of the key to use.
16 | # The password will be asked during the build when you use the 'release' target.
17 |
18 |
--------------------------------------------------------------------------------
/libs/gson-2.2.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/libs/gson-2.2.2.jar
--------------------------------------------------------------------------------
/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-17
15 | android.library.reference.1=../libsuperuser
16 |
17 |
--------------------------------------------------------------------------------
/res/drawable-hdpi/btn_default_disabled_focused_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/btn_default_disabled_focused_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/btn_default_disabled_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/btn_default_disabled_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/btn_default_focused_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/btn_default_focused_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/btn_default_normal_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/btn_default_normal_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/btn_default_pressed_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/btn_default_pressed_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_action_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/ic_action_add.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_action_add_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/ic_action_add_grey.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_action_clear.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/ic_action_clear.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_action_clear_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/ic_action_clear_grey.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_action_clear_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/ic_action_clear_white.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_action_edit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/ic_action_edit.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_action_edit_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/ic_action_edit_grey.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_action_globe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/ic_action_globe.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_action_link.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/ic_action_link.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_action_more.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/ic_action_more.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_action_more_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/ic_action_more_grey.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_action_more_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/ic_action_more_white.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_action_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/ic_action_settings.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_action_settings_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/ic_action_settings_grey.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_action_settings_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/ic_action_settings_white.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_action_trash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/ic_action_trash.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_action_trash_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/ic_action_trash_grey.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_action_trash_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/ic_action_trash_white.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/list_activated_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/list_activated_holo.9.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/list_focused_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/list_focused_holo.9.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/list_longpressed_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/list_longpressed_holo.9.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/list_pressed_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/list_pressed_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/list_selector_disabled_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/list_selector_disabled_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/shortcut_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/shortcut_icon.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/textfield_activated_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/textfield_activated_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/textfield_default_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/textfield_default_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/textfield_disabled_focused_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/textfield_disabled_focused_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/textfield_disabled_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/textfield_disabled_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/textfield_focused_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-hdpi/textfield_focused_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/btn_default_disabled_focused_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/btn_default_disabled_focused_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/btn_default_disabled_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/btn_default_disabled_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/btn_default_focused_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/btn_default_focused_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/btn_default_normal_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/btn_default_normal_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/btn_default_pressed_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/btn_default_pressed_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_action_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/ic_action_add.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_action_add_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/ic_action_add_grey.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_action_clear.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/ic_action_clear.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_action_clear_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/ic_action_clear_grey.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_action_clear_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/ic_action_clear_white.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_action_edit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/ic_action_edit.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_action_edit_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/ic_action_edit_grey.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_action_globe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/ic_action_globe.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_action_link.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/ic_action_link.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_action_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/ic_action_settings.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_action_settings_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/ic_action_settings_grey.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_action_settings_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/ic_action_settings_white.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_action_trash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/ic_action_trash.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_action_trash_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/ic_action_trash_grey.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_action_trash_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/ic_action_trash_white.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/list_activated_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/list_activated_holo.9.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/list_focused_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/list_focused_holo.9.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/list_longpressed_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/list_longpressed_holo.9.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/list_pressed_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/list_pressed_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/list_selector_disabled_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/list_selector_disabled_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/shortcut_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/shortcut_icon.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/textfield_activated_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/textfield_activated_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/textfield_default_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/textfield_default_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/textfield_disabled_focused_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/textfield_disabled_focused_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/textfield_disabled_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/textfield_disabled_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/textfield_focused_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-mdpi/textfield_focused_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/btn_default_disabled_focused_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/btn_default_disabled_focused_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/btn_default_disabled_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/btn_default_disabled_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/btn_default_focused_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/btn_default_focused_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/btn_default_normal_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/btn_default_normal_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/btn_default_pressed_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/btn_default_pressed_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/clear_data.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/clear_data.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/ic_action_add.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_add_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/ic_action_add_grey.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_clear.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/ic_action_clear.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_clear_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/ic_action_clear_grey.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_clear_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/ic_action_clear_white.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_edit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/ic_action_edit.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_edit_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/ic_action_edit_grey.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_globe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/ic_action_globe.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_link.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/ic_action_link.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/ic_action_settings.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_settings_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/ic_action_settings_grey.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_settings_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/ic_action_settings_white.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_trash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/ic_action_trash.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_trash_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/ic_action_trash_grey.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_action_trash_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/ic_action_trash_white.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/list_activated_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/list_activated_holo.9.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/list_focused_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/list_focused_holo.9.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/list_longpressed_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/list_longpressed_holo.9.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/list_pressed_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/list_pressed_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/list_selector_disabled_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/list_selector_disabled_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/shortcut_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/shortcut_icon.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/textfield_activated_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/textfield_activated_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/textfield_default_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/textfield_default_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/textfield_disabled_focused_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/textfield_disabled_focused_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/textfield_disabled_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/textfield_disabled_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/textfield_focused_holo_light.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xhdpi/textfield_focused_holo_light.9.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/shortcut_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable-xxhdpi/shortcut_icon.png
--------------------------------------------------------------------------------
/res/drawable/add_imageview.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/drawable/background_repeat.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/drawable/background_repeat_dark.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/drawable/background_texture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable/background_texture.png
--------------------------------------------------------------------------------
/res/drawable/background_texture_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable/background_texture_dark.png
--------------------------------------------------------------------------------
/res/drawable/btn_default_holo_light.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
20 |
22 |
24 |
26 |
28 |
30 |
32 |
33 |
--------------------------------------------------------------------------------
/res/drawable/clear_imageview.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/drawable/clear_imageview_dark.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/drawable/delete_imageview.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/drawable/delete_imageview_dark.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/drawable/devdrawer_widget_preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable/devdrawer_widget_preview.png
--------------------------------------------------------------------------------
/res/drawable/edit_imageview.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/drawable/edit_text_holo_light.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/res/drawable/list_selector_background_transition_holo_light.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/res/drawable/list_selector_holo_light.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/res/drawable/listview_button_background_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable/listview_button_background_normal.png
--------------------------------------------------------------------------------
/res/drawable/listview_button_background_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tunitowen/DevDrawer/e39902df0d1a394c8a7150287797aa5c80f44a34/res/drawable/listview_button_background_pressed.png
--------------------------------------------------------------------------------
/res/drawable/listview_button_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/drawable/more_imageview.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/drawable/more_imageview_dark.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/drawable/settings_imageview.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/drawable/settings_imageview_dark.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/layout-land/list_item_more.xml:
--------------------------------------------------------------------------------
1 |
5 |
15 |
20 |
31 |
44 |
52 |
59 |
67 |
--------------------------------------------------------------------------------
/res/layout-sw600dp/list_item_more.xml:
--------------------------------------------------------------------------------
1 |
5 |
15 |
20 |
31 |
44 |
52 |
59 |
67 |
--------------------------------------------------------------------------------
/res/layout/activity_choice.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
13 |
--------------------------------------------------------------------------------
/res/layout/activity_choice_list_item.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
15 |
16 |
26 |
--------------------------------------------------------------------------------
/res/layout/custom_ab_title.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/res/layout/dropdown_list_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/layout/edit_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
16 |
22 |
23 |
28 |
29 |
--------------------------------------------------------------------------------
/res/layout/legacy_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
--------------------------------------------------------------------------------
/res/layout/list_item.xml:
--------------------------------------------------------------------------------
1 |
5 |
15 |
20 |
31 |
44 |
52 |
59 |
60 |
--------------------------------------------------------------------------------
/res/layout/list_item_more.xml:
--------------------------------------------------------------------------------
1 |
5 |
15 |
20 |
31 |
44 |
52 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/res/layout/list_item_more_legacy.xml:
--------------------------------------------------------------------------------
1 |
5 |
15 |
20 |
31 |
44 |
52 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/res/layout/locale_list_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
18 |
19 |
30 |
--------------------------------------------------------------------------------
/res/layout/locale_switcher.xml:
--------------------------------------------------------------------------------
1 |
5 |
17 |
18 |
30 |
31 |
40 |
41 |
48 |
57 |
--------------------------------------------------------------------------------
/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
19 |
20 |
31 |
38 |
47 |
--------------------------------------------------------------------------------
/res/layout/package_list_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
16 |
25 |
36 |
--------------------------------------------------------------------------------
/res/layout/widget_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/res/layout/widget_layout_dark.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
13 |
21 |
--------------------------------------------------------------------------------
/res/values-v11/bools.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 |
--------------------------------------------------------------------------------
/res/values-v11/devdrawertheme_styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
10 |
13 |
14 |
--------------------------------------------------------------------------------
/res/values-v11/devdrawertheme_themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
15 |
16 |
--------------------------------------------------------------------------------
/res/values/bools.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | false
4 |
--------------------------------------------------------------------------------
/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #333333
4 | #EBEBEB
5 |
--------------------------------------------------------------------------------
/res/values/devdrawertheme_styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
10 |
11 |
17 |
18 |
21 |
22 |
28 |
29 |
--------------------------------------------------------------------------------
/res/values/devdrawertheme_themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
--------------------------------------------------------------------------------
/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | DevDrawer
4 |
5 | - Order Added
6 | - Alphabetically
7 |
8 |
9 | - added
10 | - alphabetically
11 |
12 |
13 | - Light
14 | - Dark
15 |
16 | No main activity could be found.\nEnable the activity chooser dialog.
17 | The package selected is no longer installed, if this has been uninstalled please click remove
18 | Remove
19 | Uninstalled?
20 |
21 |
22 | PACKAGE FILTER:
23 | your.company.*
24 | ADD LOCALES:
25 | Language name or code
26 | Change
27 | Change Default Locale?
28 | Change the phones default locale to
29 | Yes
30 |
31 |
32 | - AOSP Launcher
33 | - DevDrawer Original Config
34 |
35 |
36 | - aosp
37 | - devdrawer
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/res/xml/preferences.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
10 |
11 |
12 |
18 |
19 |
20 |
21 |
26 |
27 |
28 |
29 |
34 |
35 |
36 |
37 |
40 |
43 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/res/xml/widget_info.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/android/app/ActivityManagerNative.java:
--------------------------------------------------------------------------------
1 | package android.app;
2 |
3 | /**
4 | * Just stubs that the compiler doesn't complain.
5 | */
6 | public abstract class ActivityManagerNative implements IActivityManager {
7 |
8 | public static IActivityManager getDefault() {
9 | return null;
10 | }
11 |
12 | }
--------------------------------------------------------------------------------
/src/android/app/IActivityManager.java:
--------------------------------------------------------------------------------
1 | package android.app;
2 |
3 | import android.content.res.Configuration;
4 | import android.os.RemoteException;
5 |
6 | public interface IActivityManager {
7 |
8 | public abstract Configuration getConfiguration() throws RemoteException;
9 |
10 | public abstract void updateConfiguration(Configuration configuration) throws RemoteException;
11 |
12 | }
--------------------------------------------------------------------------------
/src/com/owentech/DevDrawer/activities/ChooseActivityDialog.java:
--------------------------------------------------------------------------------
1 | package com.owentech.DevDrawer.activities;
2 |
3 | import android.app.Activity;
4 | import android.content.ComponentName;
5 | import android.content.Intent;
6 | import android.content.pm.ActivityInfo;
7 | import android.content.pm.PackageInfo;
8 | import android.content.pm.PackageManager;
9 | import android.os.Bundle;
10 | import android.view.View;
11 | import android.widget.AdapterView;
12 | import android.widget.ListView;
13 | import com.owentech.DevDrawer.R;
14 | import com.owentech.DevDrawer.adapters.ActivityListAdapter;
15 |
16 | import java.util.ArrayList;
17 | import java.util.List;
18 |
19 | /**
20 | * Created with IntelliJ IDEA.
21 | * User: owent
22 | * Date: 06/02/2013
23 | * Time: 07:07
24 | * To change this template use File | Settings | File Templates.
25 | */
26 | public class ChooseActivityDialog extends Activity implements ListView.OnItemClickListener
27 | {
28 |
29 | ListView listView;
30 | String packageName;
31 | List activitiesList;
32 |
33 | @Override
34 | protected void onCreate(Bundle savedInstanceState)
35 | {
36 | super.onCreate(savedInstanceState);
37 | setContentView(R.layout.activity_choice);
38 |
39 | packageName = getIntent().getStringExtra("packageName");
40 |
41 | listView = (ListView) findViewById(R.id.listView);
42 |
43 | try
44 | {
45 | activitiesList = getActivityList(packageName);
46 | }
47 | catch(PackageManager.NameNotFoundException e)
48 | {
49 | e.printStackTrace();
50 | }
51 |
52 | listView.setAdapter(new ActivityListAdapter(this, activitiesList));
53 | listView.setOnItemClickListener(this);
54 |
55 | }
56 |
57 | private List getActivityList(String packageName)
58 | throws PackageManager.NameNotFoundException {
59 |
60 | PackageManager pm = this.getPackageManager();
61 |
62 | List adapter = new ArrayList();
63 |
64 | PackageInfo info = pm.getPackageInfo(packageName,
65 | PackageManager.GET_ACTIVITIES);
66 | ActivityInfo[] list = info.activities;
67 |
68 | if (list != null && list.length != 0)
69 | {
70 | for (ActivityInfo activity : list) {
71 | if (activity.exported) {
72 | adapter.add(activity.name.toString());
73 | }
74 | }
75 | }
76 |
77 | return adapter;
78 | }
79 |
80 | @Override
81 | public void onItemClick(AdapterView> adapterView, View view, int i, long l)
82 | {
83 | Intent intent = new Intent();
84 | intent.setComponent(new ComponentName(
85 | packageName, activitiesList.get(i)
86 | .toString()));
87 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
88 | startActivity(intent);
89 | finish();
90 | }
91 |
92 | }
93 |
--------------------------------------------------------------------------------
/src/com/owentech/DevDrawer/activities/ClickHandlingActivity.java:
--------------------------------------------------------------------------------
1 | package com.owentech.DevDrawer.activities;
2 |
3 | import android.app.Activity;
4 | import android.app.AlertDialog;
5 | import android.app.Dialog;
6 | import android.appwidget.AppWidgetManager;
7 | import android.content.*;
8 | import android.content.pm.PackageManager;
9 | import android.net.Uri;
10 | import android.os.Build;
11 | import android.os.Bundle;
12 | import android.preference.PreferenceManager;
13 | import android.util.Log;
14 | import android.widget.Toast;
15 | import com.owentech.DevDrawer.R;
16 | import com.owentech.DevDrawer.appwidget.DDWidgetProvider;
17 | import com.owentech.DevDrawer.utils.Constants;
18 | import com.owentech.DevDrawer.utils.Database;
19 | import com.owentech.DevDrawer.utils.RootFeatures;
20 |
21 | /**
22 | * Created with IntelliJ IDEA.
23 | * User: owent
24 | * Date: 29/01/2013
25 | * Time: 06:31
26 | * To change this template use File | Settings | File Templates.
27 | */
28 | public class ClickHandlingActivity extends Activity
29 | {
30 | SharedPreferences sp;
31 |
32 | @Override
33 | public void onCreate(Bundle state)
34 | {
35 | super.onCreate(state);
36 |
37 | final String packageName = getIntent().getStringExtra(DDWidgetProvider.PACKAGE_STRING);
38 | int launchType = getIntent().getIntExtra("launchType", 0);
39 |
40 | sp = PreferenceManager.getDefaultSharedPreferences(this);
41 |
42 | if(packageName != null && isAppInstalled(packageName))
43 | {
44 |
45 | switch(launchType)
46 | {
47 | case Constants.LAUNCH_APP:
48 | {
49 | startApp(this, packageName);
50 | break;
51 | }
52 | case Constants.LAUNCH_APP_DETAILS:
53 | {
54 | startAppDetails(this, packageName);
55 | break;
56 | }
57 | case Constants.LAUNCH_UNINSTALL:
58 | {
59 | startUninstall(this, packageName);
60 | break;
61 | }
62 | case Constants.LAUNCH_CLEAR:
63 | {
64 | startClearCache(this, packageName);
65 | break;
66 | }
67 | case Constants.LAUNCH_MORE:
68 | {
69 | startMoreOverflowMenu(this, packageName);
70 | break;
71 | }
72 | }
73 | }
74 | else
75 | {
76 | Toast.makeText(getApplicationContext(), "Package is not installed", Toast.LENGTH_SHORT).show();
77 |
78 | AlertDialog.Builder builder = new AlertDialog.Builder(ClickHandlingActivity.this);
79 | builder.setTitle(getResources().getString(R.string.uninstalled));
80 | builder.setMessage(getResources().getString(R.string.package_does_not_exist));
81 | builder.setPositiveButton(getResources().getString(R.string.remove), new DialogInterface.OnClickListener()
82 | {
83 | @Override
84 | public void onClick(DialogInterface dialogInterface, int i)
85 | {
86 | new Database(getApplicationContext()).deleteAppFromDb(packageName);
87 |
88 | AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(getApplicationContext());
89 | int[] appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(getApplicationContext(), DDWidgetProvider.class));
90 | appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds, R.id.listView);
91 |
92 | finish();
93 | }
94 | });
95 | builder.setCancelable(true);
96 | builder.setOnCancelListener(new DialogInterface.OnCancelListener()
97 | {
98 | @Override
99 | public void onCancel(DialogInterface dialogInterface)
100 | {
101 | finish();
102 | }
103 | });
104 |
105 | AlertDialog alert = builder.create();
106 | alert.show();
107 | }
108 | }
109 |
110 | // Method to check whether the Facebook App is installed
111 | private boolean isAppInstalled(String uri)
112 | {
113 | PackageManager pm = getPackageManager();
114 | boolean app_installed;
115 | try
116 | {
117 | pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES);
118 | app_installed = true;
119 | }
120 | catch(PackageManager.NameNotFoundException e)
121 | {
122 | app_installed = false;
123 | }
124 | return app_installed;
125 | }
126 |
127 | public static void startApp(Activity activity, String packageName)
128 | {
129 | SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(activity);
130 | if(sp.getBoolean("showActivityChoice", false))
131 | {
132 | // Show the activity choice dialog
133 | Intent intent = new Intent(activity, ChooseActivityDialog.class);
134 | if(sp.getString("launchingIntents", "aosp").equals("aosp")){
135 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
136 | }
137 | else{
138 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NO_HISTORY);
139 | }
140 | intent.putExtra("packageName", packageName);
141 | activity.startActivity(intent);
142 | activity.finish();
143 |
144 |
145 | }else
146 | {
147 | // Launch the app
148 | try
149 | {
150 | Intent LaunchIntent = activity.getPackageManager()
151 | .getLaunchIntentForPackage(packageName);
152 | LaunchIntent.addCategory(Intent.CATEGORY_LAUNCHER);
153 | if(sp.getString("launchingIntents", "aosp").equals("aosp")){
154 | LaunchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
155 | }
156 | else{
157 | LaunchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NO_HISTORY);
158 | }
159 |
160 | activity.startActivity(LaunchIntent);
161 | }
162 | catch(NullPointerException e)
163 | {
164 | Toast.makeText(activity, activity.getString(
165 | R.string.no_main_activity_could_be_found), Toast.LENGTH_SHORT)
166 | .show();
167 | Intent intent = new Intent(activity, PrefActivity.class);
168 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
169 | Intent.FLAG_ACTIVITY_CLEAR_TOP);
170 | activity.startActivity(intent);
171 | }
172 | activity.finish();
173 | }
174 | }
175 |
176 | public static void startAppDetails(Activity activity, String packageName)
177 | {
178 | // Launch the app details settings screen for the app
179 | Intent intent = new Intent();
180 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
181 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD)
182 | {
183 | intent.setAction(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
184 | intent.addCategory(Intent.CATEGORY_DEFAULT);
185 | intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
186 | intent.setData(Uri.parse("package:" + packageName));
187 | }
188 | else
189 | {
190 | // on FroYo and Eclair it's just horrible...
191 | final String APP_PKG_NAME_21 = "com.android.settings.ApplicationPkgName";
192 | final String APP_PKG_NAME_22 = "pkg";
193 | final String APP_DETAILS_PACKAGE_NAME = "com.android.settings";
194 | final String APP_DETAILS_CLASS_NAME = "com.android.settings.InstalledAppDetails";
195 | final String appPkgName = (Build.VERSION.SDK_INT == Build.VERSION_CODES.FROYO ? APP_PKG_NAME_22 : APP_PKG_NAME_21);
196 | intent.setAction(Intent.ACTION_VIEW);
197 | intent.setClassName(APP_DETAILS_PACKAGE_NAME, APP_DETAILS_CLASS_NAME);
198 | intent.putExtra(appPkgName, packageName);
199 | }
200 | activity.startActivity(intent);
201 |
202 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
203 | activity.finish();
204 | }
205 | }
206 | public static void startClearCache(Activity activity, String packageName)
207 | {
208 | final Context context = activity.getApplicationContext();
209 | activity.finish();
210 | RootFeatures.clearCache(packageName, new RootFeatures.Listener() {
211 |
212 | @Override
213 | public void onFinished(boolean result) {
214 | if (result == false) {
215 | Toast.makeText(context, "No root access available", Toast.LENGTH_SHORT).show();
216 | }
217 | }
218 | });
219 | }
220 |
221 | public static void startMoreOverflowMenu(final Activity activity, final String packageName)
222 | {
223 | try {
224 | PackageManager pm = activity.getPackageManager();
225 | AlertDialog.Builder builder = new AlertDialog.Builder(activity);
226 | Dialog dlg = builder.setTitle(pm.getApplicationLabel(pm.getApplicationInfo(packageName, 0)))
227 | .setItems(new CharSequence[] { "View details", "Clear cache"}, new DialogInterface.OnClickListener() {
228 | @Override
229 | public void onClick(DialogInterface dialog, int which) {
230 | if (which == 0) {
231 | startAppDetails(activity, packageName);
232 | }
233 | else if (which == 1) {
234 | startClearCache(activity, packageName);
235 | }
236 | }
237 | })
238 | .setOnCancelListener(new DialogInterface.OnCancelListener() {
239 | @Override
240 | public void onCancel(DialogInterface dialog) {
241 | activity.finish();
242 | }
243 | })
244 | .create();
245 | dlg.show();
246 | }
247 | catch(PackageManager.NameNotFoundException e) {
248 | }
249 | }
250 |
251 | public static void startUninstall(Activity activity, String packageName)
252 | {
253 |
254 | SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(activity);
255 | if(sp.getBoolean("rootQuickUninstall", false)) {
256 | final Context context = activity.getApplicationContext();
257 | activity.finish();
258 | RootFeatures.uninstall(packageName, new RootFeatures.Listener() {
259 |
260 | @Override
261 | public void onFinished(boolean result) {
262 | if (result == false) {
263 | Toast.makeText(context, "No root access available", Toast.LENGTH_SHORT).show();
264 | }
265 | }
266 | });
267 | }
268 | else {
269 | if (Build.VERSION.SDK_INT > Build.VERSION_CODES.GINGERBREAD_MR1)
270 | {
271 | try
272 | {
273 | Uri packageUri = Uri.parse("package:" + packageName);
274 | Intent uninstallIntent =
275 | new Intent(Intent.ACTION_UNINSTALL_PACKAGE, packageUri);
276 | uninstallIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
277 | activity.startActivity(uninstallIntent);
278 | activity.finish();
279 | }
280 | catch (ActivityNotFoundException e)
281 | {
282 | Toast.makeText(activity, "Application cannot be uninstalled / possibly system app", Toast.LENGTH_SHORT).show();
283 | }
284 | }
285 | else
286 | {
287 | Intent intent = new Intent(Intent.ACTION_DELETE);
288 | intent.setData(Uri.parse("package:" + packageName));
289 | activity.startActivity(intent);
290 | }
291 | }
292 | }
293 |
294 |
295 |
296 | }
297 |
--------------------------------------------------------------------------------
/src/com/owentech/DevDrawer/activities/EditDialog.java:
--------------------------------------------------------------------------------
1 | package com.owentech.DevDrawer.activities;
2 |
3 | import android.app.Activity;
4 | import android.content.Intent;
5 | import android.os.Bundle;
6 | import android.view.View;
7 | import android.widget.Button;
8 | import android.widget.EditText;
9 | import com.owentech.DevDrawer.R;
10 | import com.owentech.DevDrawer.utils.Constants;
11 |
12 | /**
13 | * Created with IntelliJ IDEA.
14 | * User: owent
15 | * Date: 31/01/2013
16 | * Time: 20:58
17 | * To change this template use File | Settings | File Templates.
18 | */
19 | public class EditDialog extends Activity
20 | {
21 |
22 | EditText editText;
23 | Button changeButton;
24 |
25 | String originalText;
26 | String id;
27 |
28 | @Override
29 | protected void onCreate(Bundle savedInstanceState)
30 | {
31 | super.onCreate(savedInstanceState);
32 | setContentView(R.layout.edit_dialog);
33 |
34 | editText = (EditText) findViewById(R.id.editDialogEditText);
35 | changeButton = (Button) findViewById(R.id.changeButton);
36 |
37 | Bundle bundle = getIntent().getExtras();
38 |
39 | originalText = bundle.getString("text");
40 | id = bundle.getString("id");
41 |
42 | editText.setText(originalText);
43 |
44 | // Change button sends a result back to MainActivity
45 | changeButton.setOnClickListener(new View.OnClickListener()
46 | {
47 | @Override
48 | public void onClick(View view)
49 | {
50 |
51 | Intent intent = new Intent();
52 | Bundle bundle = new Bundle();
53 | bundle.putString("newText", editText.getText().toString());
54 | bundle.putString("id", id);
55 | intent.putExtras(bundle);
56 |
57 | setResult(Constants.EDIT_DIALOG_CHANGE, intent);
58 | finish();
59 |
60 | }
61 | });
62 |
63 | }
64 |
65 | @Override
66 | protected void onStop()
67 | {
68 | super.onStop();
69 | finish();
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/src/com/owentech/DevDrawer/activities/LegacyDialog.java:
--------------------------------------------------------------------------------
1 | package com.owentech.DevDrawer.activities;
2 |
3 | import android.annotation.TargetApi;
4 | import android.app.Activity;
5 | import android.content.SharedPreferences;
6 | import android.os.Build;
7 | import android.os.Bundle;
8 | import android.preference.PreferenceManager;
9 | import android.view.Window;
10 | import android.widget.ListView;
11 | import com.owentech.DevDrawer.R;
12 | import com.owentech.DevDrawer.adapters.LegacyListAdapter;
13 |
14 | public class LegacyDialog extends Activity
15 | {
16 |
17 | ListView legacyListView;
18 |
19 | @Override
20 | protected void onCreate(Bundle savedInstanceState)
21 | {
22 | getWindow().requestFeature(Window.FEATURE_NO_TITLE);
23 | super.onCreate(savedInstanceState);
24 |
25 | setContentView(R.layout.legacy_dialog);
26 | legacyListView = (ListView) findViewById(R.id.legacyListView);
27 |
28 | SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
29 |
30 | int bgResId = -1;
31 | if(sharedPreferences.getString("theme", "Light").equals("Light"))
32 | {
33 | bgResId = R.drawable.background_repeat;
34 | }
35 | else
36 | {
37 | bgResId = R.drawable.background_repeat_dark;
38 | }
39 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
40 | legacyListView.setBackgroundDrawable(getResources().getDrawable(bgResId));
41 | }
42 | else {
43 | setLegacyBackgroundPostJB(bgResId);
44 | }
45 |
46 | LegacyListAdapter listAdapter = new LegacyListAdapter(this);
47 | legacyListView.setAdapter(listAdapter);
48 | }
49 |
50 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
51 | private void setLegacyBackgroundPostJB(int bgResId) {
52 | legacyListView.setBackground(getResources().getDrawable(bgResId));
53 | }
54 |
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/src/com/owentech/DevDrawer/activities/LocaleSwitcher.java:
--------------------------------------------------------------------------------
1 | package com.owentech.DevDrawer.activities;
2 |
3 | import android.app.Activity;
4 | import android.app.ActivityManagerNative;
5 | import android.app.AlertDialog;
6 | import android.app.IActivityManager;
7 | import android.content.Context;
8 | import android.content.DialogInterface;
9 | import android.content.SharedPreferences;
10 | import android.content.res.Configuration;
11 | import android.os.Bundle;
12 | import android.preference.PreferenceManager;
13 | import android.text.Editable;
14 | import android.text.TextWatcher;
15 | import android.util.Log;
16 | import android.view.View;
17 | import android.widget.*;
18 |
19 | import com.google.gson.Gson;
20 |
21 | import com.owentech.DevDrawer.R;
22 | import com.owentech.DevDrawer.adapters.LocaleListAdapter;
23 | import com.owentech.DevDrawer.adapters.PartialMatchAdapter;
24 | import com.owentech.DevDrawer.utils.Database;
25 | import com.owentech.DevDrawer.utils.RootFeatures;
26 |
27 | import java.util.*;
28 |
29 | public class LocaleSwitcher extends Activity implements TextWatcher
30 | {
31 | ListView localeListView;
32 | List localeAutoCompleteList;
33 | AutoCompleteTextView addLocaleEditText;
34 | PartialMatchAdapter partialMatchAdapter;
35 | ImageView addImageView;
36 | Database database;
37 | LocaleListAdapter localeListAdapter;
38 | Button defaultLocale;
39 | Locale baseLocale;
40 | SharedPreferences sharedPreferences;
41 |
42 | @Override
43 | protected void onCreate(Bundle savedInstanceState)
44 | {
45 | super.onCreate(savedInstanceState);
46 | setContentView(R.layout.locale_switcher);
47 |
48 | setTitle("Locale Switcher");
49 |
50 | sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
51 |
52 | setupView();
53 |
54 | if (sharedPreferences.getString("baseLocale", null) == null) {
55 | setBaseLocaleFromSystem();
56 | saveLocaleToSharedPrefs();
57 | setDefaultLocaleButtonText();
58 | }
59 | else {
60 | getLocaleFromSharedPrefs();
61 | setDefaultLocaleButtonText();
62 | }
63 |
64 | defaultLocale.setOnClickListener(new View.OnClickListener()
65 | {
66 | @Override
67 | public void onClick(View view)
68 | {
69 | if (baseLocale != null)
70 | {
71 | switchLocales(baseLocale.getLanguage(), baseLocale.getCountry());
72 | }
73 | }
74 | });
75 |
76 | defaultLocale.setOnLongClickListener(new View.OnLongClickListener()
77 | {
78 | @Override
79 | public boolean onLongClick(View view)
80 | {
81 |
82 | AlertDialog.Builder builder = new AlertDialog.Builder(LocaleSwitcher.this)
83 | .setTitle(getResources().getString(R.string.change_locale_dialog_title))
84 | .setMessage(getResources().getString(R.string.change_locale_dialog_text) +
85 | LocaleSwitcher.this.getResources().getConfiguration().locale.getDisplayLanguage() + " ?")
86 | .setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener()
87 | {
88 | @Override
89 | public void onClick(DialogInterface dialogInterface, int i)
90 | {
91 | setBaseLocaleFromSystem();
92 | saveLocaleToSharedPrefs();
93 | setDefaultLocaleButtonText();
94 |
95 | }
96 | });
97 |
98 | AlertDialog alertDialog = builder.create();
99 | alertDialog.show();
100 |
101 | return true;
102 | }
103 | });
104 |
105 | database = new Database(this);
106 |
107 | localeListAdapter = new LocaleListAdapter(this);
108 | localeListView.setAdapter(localeListAdapter);
109 |
110 | localeAutoCompleteList = localeAutoCompleteList();
111 | partialMatchAdapter = new PartialMatchAdapter(this, localeAutoCompleteList);
112 | addLocaleEditText.setAdapter(partialMatchAdapter);
113 | addLocaleEditText.addTextChangedListener(this);
114 |
115 | addImageView.setOnClickListener(new View.OnClickListener()
116 | {
117 | @Override
118 | public void onClick(View view)
119 | {
120 | database.addLocale(addLocaleEditText.getText().toString());
121 | updateListView();
122 | addLocaleEditText.setText("");
123 | }
124 | });
125 |
126 | localeListView.setOnItemClickListener(new AdapterView.OnItemClickListener()
127 | {
128 | @Override
129 | public void onItemClick(AdapterView> adapterView, View view, int position, long l)
130 | {
131 | String language = database.getLocales().get(position);
132 | language = language.substring(language.indexOf('(') + 1);
133 | language = language.substring(0, language.indexOf(')'));
134 |
135 | String[] localeArray = language.split("_");
136 |
137 | if(localeArray.length > 1)
138 | {
139 | switchLocales(localeArray[0], localeArray[1]);
140 | }
141 | else
142 | {
143 | switchLocales(localeArray[0], null);
144 | }
145 | }
146 | });
147 |
148 | }
149 |
150 | private void setupView()
151 | {
152 | defaultLocale = (Button) findViewById(R.id.defaultLocaleButton);
153 | localeListView = (ListView) findViewById(R.id.localeListView);
154 | addImageView = (ImageView) findViewById(R.id.addButton);
155 | addLocaleEditText = (AutoCompleteTextView) findViewById(R.id.addLocaleEditText);
156 | }
157 |
158 | // Method to re-populate the ListView
159 | private void updateListView()
160 | {
161 | localeListAdapter = null;
162 | localeListAdapter = new LocaleListAdapter(this);
163 | localeListView.setAdapter(localeListAdapter);
164 | localeListAdapter.notifyDataSetChanged();
165 | }
166 |
167 | private List localeAutoCompleteList()
168 | {
169 | List list = new ArrayList();
170 |
171 | Locale baseLocale = new Locale("en");
172 |
173 | String[] languageCodes = getAssets().getLocales();
174 | Arrays.sort(languageCodes);
175 |
176 | for (String langCode : languageCodes)
177 | {
178 | Locale locale = new Locale(langCode);
179 | list.add(locale.getDisplayName(baseLocale) + " (" + langCode + ")");
180 | }
181 |
182 | return list;
183 |
184 | }
185 |
186 | @Override
187 | public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3)
188 | {}
189 |
190 | @Override
191 | public void onTextChanged(CharSequence charSequence, int i, int i2, int i3)
192 | {
193 | partialMatchAdapter.getFilter().filter(charSequence.toString());
194 | }
195 |
196 | @Override
197 | public void afterTextChanged(Editable editable)
198 | {}
199 |
200 | private void switchLocales(String language, String country)
201 | {
202 | Locale locale;
203 |
204 | if (country != null)
205 | {
206 | locale = new Locale(language, country);
207 | }
208 | else
209 | {
210 | locale = new Locale(language);
211 | }
212 |
213 |
214 | try {
215 | IActivityManager am = ActivityManagerNative.getDefault();
216 |
217 | Configuration config = am.getConfiguration();
218 | config.locale = locale;
219 | am.updateConfiguration(config);
220 |
221 | } catch (SecurityException e) {
222 | // need a little root magic to change it on Android 4.2
223 | final Context context = getApplicationContext();
224 | RootFeatures.changeSystemLocale(getPackageCodePath(), language, country, new RootFeatures.Listener() {
225 | @Override
226 | public void onFinished(boolean result) {
227 | if (result == false) {
228 | Toast.makeText(context, "No root access available", Toast.LENGTH_SHORT).show();
229 | }
230 | }
231 | });
232 |
233 | } catch (Exception e) {
234 | Log.e("LS", "Error while changing the language!", e);
235 | }
236 | }
237 |
238 | private void setBaseLocaleFromSystem()
239 | {
240 | baseLocale = getResources().getConfiguration().locale;
241 | }
242 |
243 | private void saveLocaleToSharedPrefs()
244 | {
245 | Gson gson = new Gson();
246 | String jsonLocale = gson.toJson(baseLocale, Locale.class);
247 | SharedPreferences.Editor editor = sharedPreferences.edit();
248 | editor.putString("baseLocale", jsonLocale);
249 | editor.commit();
250 | }
251 |
252 | private void getLocaleFromSharedPrefs()
253 | {
254 | Gson gson = new Gson();
255 | baseLocale = gson.fromJson(sharedPreferences.getString("baseLocale", null), Locale.class);
256 | }
257 |
258 | private void setDefaultLocaleButtonText()
259 | {
260 | defaultLocale.setText(baseLocale.getDisplayLanguage(baseLocale) + " (" + baseLocale.getLanguage() + ")");
261 | }
262 | }
263 |
--------------------------------------------------------------------------------
/src/com/owentech/DevDrawer/activities/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.owentech.DevDrawer.activities;
2 |
3 | import android.app.Activity;
4 | import android.appwidget.AppWidgetManager;
5 | import android.content.Context;
6 | import android.content.Intent;
7 | import android.content.pm.PackageManager;
8 | import android.content.pm.ResolveInfo;
9 | import android.os.Build;
10 | import android.os.Bundle;
11 | import android.text.Editable;
12 | import android.text.TextWatcher;
13 | import android.view.LayoutInflater;
14 | import android.view.Menu;
15 | import android.view.MenuItem;
16 | import android.view.View;
17 | import android.widget.AutoCompleteTextView;
18 | import android.widget.ImageView;
19 | import android.widget.ListView;
20 | import android.widget.RemoteViews;
21 | import android.widget.Toast;
22 |
23 | import com.owentech.DevDrawer.R;
24 | import com.owentech.DevDrawer.adapters.FilterListAdapter;
25 | import com.owentech.DevDrawer.appwidget.DDWidgetProvider;
26 | import com.owentech.DevDrawer.adapters.PartialMatchAdapter;
27 | import com.owentech.DevDrawer.utils.AddAllAppsAsync;
28 | import com.owentech.DevDrawer.utils.Constants;
29 | import com.owentech.DevDrawer.utils.Database;
30 |
31 | import java.text.Collator;
32 | import java.util.ArrayList;
33 | import java.util.Collections;
34 | import java.util.HashSet;
35 | import java.util.List;
36 | import java.util.Set;
37 |
38 | public class MainActivity extends Activity implements TextWatcher
39 | {
40 |
41 | Database database;
42 |
43 | ImageView addButton;
44 | AutoCompleteTextView addPackageAutoComplete;
45 | FilterListAdapter lviewAdapter;
46 | ListView listView;
47 | PartialMatchAdapter partialMatchAdapter;
48 |
49 | List appPackages;
50 |
51 | @Override
52 | public void onCreate(Bundle state)
53 | {
54 | super.onCreate(state);
55 |
56 | setContentView(R.layout.main);
57 |
58 | // Set up ActionBar to use custom view (Robot Light font)
59 | if (Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB)
60 | {
61 | getActionBar().setDisplayShowTitleEnabled(false);
62 | LayoutInflater inflater = LayoutInflater.from(this);
63 | View customView = inflater.inflate(R.layout.custom_ab_title, null);
64 | getActionBar().setCustomView(customView);
65 | getActionBar().setDisplayShowCustomEnabled(true);
66 | }
67 |
68 | // Create the database tables
69 | database = new Database(this);
70 | database.createTables();
71 |
72 | // Setup view components
73 | addButton = (ImageView) findViewById(R.id.addButton);
74 | addPackageAutoComplete = (AutoCompleteTextView) findViewById(R.id.addPackageEditText);
75 | listView = (ListView) findViewById(R.id.packagesListView);
76 |
77 | appPackages = getExistingPackages();
78 |
79 | partialMatchAdapter = new PartialMatchAdapter(this, appPackages);
80 | addPackageAutoComplete.setAdapter(partialMatchAdapter);
81 | addPackageAutoComplete.addTextChangedListener(this);
82 |
83 | // Update the ListView from the database
84 | updateListView();
85 |
86 | addButton.setOnClickListener(new View.OnClickListener()
87 | {
88 | @Override
89 | public void onClick(View view)
90 | {
91 |
92 | if(addPackageAutoComplete.getText().length() != 0) // Check something entered
93 | {
94 | // Check filter doesn't exist
95 | if(!database.doesFilterExist(addPackageAutoComplete.getText().toString()))
96 | {
97 | // Add the filter to the database
98 | database.addFilterToDatabase(addPackageAutoComplete.getText().toString());
99 |
100 | // Check existing apps and add to installed apps table if they match new filter
101 | new AddAllAppsAsync(getApplicationContext(), addPackageAutoComplete.getText().toString()).execute();
102 |
103 | addPackageAutoComplete.setText("");
104 | updateListView();
105 |
106 | }
107 | else
108 | {
109 | Toast.makeText(getApplicationContext(), "Filter already exists", Toast.LENGTH_SHORT).show();
110 | }
111 | }
112 |
113 | }
114 | });
115 |
116 |
117 | }
118 |
119 | @Override
120 | public void onBackPressed() {
121 |
122 | Intent intent = getIntent();
123 | Bundle extras = intent.getExtras();
124 | int appWidgetId = AppWidgetManager.INVALID_APPWIDGET_ID;
125 | if (extras != null) {
126 | appWidgetId = extras.getInt(
127 | AppWidgetManager.EXTRA_APPWIDGET_ID,
128 | AppWidgetManager.INVALID_APPWIDGET_ID);
129 | }
130 |
131 | if (appWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID) {
132 | AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(this);
133 | RemoteViews widget = DDWidgetProvider.getRemoteViews(this,appWidgetId);
134 | appWidgetManager.updateAppWidget(appWidgetId, widget);
135 | Intent resultValue = new Intent();
136 | resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
137 | setResult(RESULT_OK, resultValue);
138 | finish();
139 | }
140 |
141 | super.onBackPressed();
142 | }
143 |
144 | // Method to re-populate the ListView
145 | public void updateListView()
146 | {
147 | lviewAdapter = null;
148 | lviewAdapter = new FilterListAdapter(this, database.getAllFiltersInDatabase());
149 | listView.setAdapter(lviewAdapter);
150 | lviewAdapter.notifyDataSetChanged();
151 | }
152 |
153 | @Override
154 | protected void onActivityResult(int requestCode, int resultCode, Intent data)
155 | {
156 | super.onActivityResult(requestCode, resultCode, data);
157 |
158 | // Catch the return from the EditDialog
159 | if(resultCode == Constants.EDIT_DIALOG_CHANGE)
160 | {
161 | Bundle bundle = data.getExtras();
162 |
163 | Database database = new Database(this);
164 | database.amendFilterEntryTo(bundle.getString("id"), bundle.getString("newText"));
165 | updateListView();
166 | }
167 | }
168 |
169 | @Override
170 | public boolean onCreateOptionsMenu(Menu menu)
171 | {
172 | if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
173 | {
174 | menu.add(0, Constants.MENU_SHORTCUT, 0, "Create Legacy Shortcut").setShowAsAction(MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);
175 | menu.add(0, Constants.MENU_SETTINGS, 0, "Settings").setIcon(R.drawable.ic_action_settings_white).setShowAsAction(MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);
176 | //menu.add(0, Constants.MENU_LOCALE_SWITCHER, 0, "Locale Switcher").setIcon(R.drawable.ic_action_globe).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
177 | }
178 | else
179 | {
180 | menu.add(0, Constants.MENU_SHORTCUT, 0, "Create Shortcut");
181 | menu.add(0, Constants.MENU_SETTINGS, 0, "Settings");
182 | //menu.add(0, Constants.MENU_LOCALE_SWITCHER, 0, "Locale Switcher");
183 | }
184 | return true;
185 | }
186 |
187 | @Override
188 | public boolean onMenuItemSelected(int featureId, MenuItem item)
189 | {
190 | switch(item.getItemId())
191 | {
192 | case Constants.MENU_SHORTCUT:
193 | {
194 | addShortcut(this);
195 | break;
196 | }
197 | case Constants.MENU_SETTINGS:
198 | {
199 | startActivity(new Intent(MainActivity.this, PrefActivity.class));
200 | break;
201 | }
202 | case Constants.MENU_LOCALE_SWITCHER:
203 | {
204 |
205 | startActivity(new Intent(this, LocaleSwitcher.class));
206 | break;
207 | }
208 | }
209 | return false;
210 | }
211 |
212 | public void addShortcut(Context context) {
213 | Intent shortcutIntent = new Intent(this, LegacyDialog.class);
214 | shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
215 | shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
216 |
217 | Intent intent = new Intent();
218 | intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
219 | intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "^DevDrawer");
220 | intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, Intent.ShortcutIconResource.fromContext(context, R.drawable.shortcut_icon));
221 | intent.setAction("com.android.launcher.action.INSTALL_SHORTCUT");
222 | String shortcutUri = intent.toUri(MODE_WORLD_WRITEABLE);
223 | context.sendBroadcast(intent);
224 | }
225 |
226 | @Override
227 | protected void onStop()
228 | {
229 | super.onStop();
230 | //TODO is this really needed? It makes the prefActivity to close the app on backpress
231 | // this is called to prevent a new app, back pressed, opening this activity
232 | finish();
233 | }
234 |
235 | // Method to get all apps installed and return as List
236 | List getExistingPackages()
237 | {
238 | // get installed applications
239 | PackageManager pm = this.getPackageManager();
240 | Intent intent = new Intent(Intent.ACTION_MAIN, null);
241 | intent.addCategory(Intent.CATEGORY_LAUNCHER);
242 | List list= pm.queryIntentActivities(intent,
243 | PackageManager.PERMISSION_GRANTED);
244 |
245 | Set appSet = new HashSet();
246 |
247 | for (ResolveInfo rInfo : list) {
248 | String appName = rInfo.activityInfo.applicationInfo.packageName.toString();
249 | appSet.add(appName);
250 | while (appName.length() > 0) {
251 | int lastIndex = appName.lastIndexOf(".");
252 | if (lastIndex > 0) {
253 | appName = appName.substring(0,lastIndex);
254 | appSet.add(appName+".*");
255 | } else {
256 | appName = "";
257 | }
258 | }
259 | }
260 |
261 | Collator collator = Collator.getInstance();
262 | ArrayList appList = new ArrayList(appSet);
263 | Collections.sort(appList, collator);
264 | return appList;
265 | }
266 |
267 | @Override
268 | public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3)
269 | {}
270 |
271 | @Override
272 | public void onTextChanged(CharSequence charSequence, int i, int i2, int i3)
273 | {}
274 |
275 | @Override
276 | public void afterTextChanged(Editable editable)
277 | {
278 | partialMatchAdapter.getFilter().filter(editable.toString());
279 | }
280 |
281 | }
282 |
--------------------------------------------------------------------------------
/src/com/owentech/DevDrawer/activities/PrefActivity.java:
--------------------------------------------------------------------------------
1 | package com.owentech.DevDrawer.activities;
2 |
3 | import android.app.AlertDialog;
4 | import android.appwidget.AppWidgetManager;
5 | import android.content.ComponentName;
6 | import android.content.Intent;
7 | import android.content.Context;
8 | import android.content.SharedPreferences;
9 | import android.os.Bundle;
10 | import android.os.Handler;
11 | import android.os.Message;
12 | import android.preference.*;
13 | import android.widget.Toast;
14 |
15 | import com.owentech.DevDrawer.R;
16 | import com.owentech.DevDrawer.appwidget.DDWidgetProvider;
17 | import com.owentech.DevDrawer.utils.RootFeatures;
18 |
19 | import java.lang.ref.WeakReference;
20 |
21 | /**
22 | * Created with IntelliJ IDEA.
23 | * User: owent
24 | * Date: 04/02/2013
25 | * Time: 16:33
26 | * To change this template use File | Settings | File Templates.
27 | */
28 | public class PrefActivity extends PreferenceActivity
29 | {
30 | SharedPreferences sp;
31 | SwitchPreference rootPref;
32 | CheckBoxPreference rootQuickUninstall;
33 | CheckBoxPreference rootClearCache;
34 |
35 | @Override
36 | protected void onCreate(Bundle savedInstanceState)
37 | {
38 | super.onCreate(savedInstanceState);
39 | addPreferencesFromResource(R.xml.preferences);
40 |
41 | sp = getPreferenceManager().getSharedPreferences();
42 |
43 | ListPreference activityChoicePref = (ListPreference)findPreference("widgetSorting");
44 | ListPreference themePref = (ListPreference)findPreference("theme");
45 | ListPreference intentsPref = (ListPreference)findPreference("launchingIntents");
46 |
47 | activityChoicePref.setSummary(nameFromValue(sp.getString("widgetSorting", "order"), activityChoicePref));
48 | themePref.setSummary(sp.getString("theme", "Light"));
49 | intentsPref.setSummary(intentNameFromValue(sp.getString("launchingIntents", "aosp"), intentsPref));
50 |
51 | activityChoicePref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
52 | {
53 | @Override
54 | public boolean onPreferenceChange(Preference preference, Object newValue)
55 | {
56 | SharedPreferences.Editor editor = sp.edit();
57 | editor.putString(preference.getKey(), newValue.toString());
58 | editor.commit();
59 |
60 | preference.setSummary(nameFromValue(newValue.toString(), preference));
61 |
62 | AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(getApplicationContext());
63 | int[] appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(getApplicationContext(), DDWidgetProvider.class));
64 | appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds, R.id.listView);
65 |
66 | return false;
67 | }
68 | });
69 |
70 | themePref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
71 | {
72 | @Override
73 | public boolean onPreferenceChange(Preference preference, Object newValue)
74 | {
75 | SharedPreferences.Editor editor = sp.edit();
76 | editor.putString(preference.getKey(), newValue.toString());
77 | editor.commit();
78 |
79 | preference.setSummary(newValue.toString());
80 |
81 | Toast.makeText(PrefActivity.this, "You may need to re-add the widget for this change to take effect", Toast.LENGTH_SHORT).show();
82 |
83 | return false;
84 | }
85 | });
86 |
87 | intentsPref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
88 | {
89 | @Override
90 | public boolean onPreferenceChange(Preference preference, Object newValue)
91 | {
92 | SharedPreferences.Editor editor = sp.edit();
93 | editor.putString(preference.getKey(), newValue.toString());
94 | editor.commit();
95 |
96 | preference.setSummary(intentNameFromValue(newValue.toString(), preference));
97 |
98 | return false;
99 | }
100 | });
101 |
102 | rootPref = (SwitchPreference)findPreference("rootEnabled");
103 | rootPref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
104 | @Override
105 | public boolean onPreferenceChange(Preference preference, Object newValue) {
106 | toggleRootAccess((Boolean)newValue);
107 | return true;
108 | }
109 | });
110 |
111 | rootQuickUninstall = (CheckBoxPreference)findPreference("rootQuickUninstall");
112 |
113 | rootClearCache = (CheckBoxPreference)findPreference("rootClearCache");
114 | rootClearCache.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
115 | @Override
116 | public boolean onPreferenceChange(Preference preference, Object newValue) {
117 | Toast.makeText(PrefActivity.this, "You may need to re-add the widget for this change to take effect", Toast.LENGTH_SHORT).show();
118 | return true;
119 | }
120 | });
121 | }
122 |
123 | @Override
124 | public void onBackPressed() {
125 | //TODO check the todo on MainActivity. This is a workaround to it
126 | startActivity(new Intent(PrefActivity.this,MainActivity.class));
127 | finish();
128 | }
129 |
130 | /*
131 | * Handler to receive result from AsyncTask
132 | *
133 | * When the screen orientation changes right after switching Root featues ON/OFF
134 | * then we won't receive the result from the AsyncTask, and therefore the Root
135 | * features would be enabled even though there's no root available.
136 | *
137 | * Inspired from the following article
138 | * http://www.androiddesignpatterns.com/2013/01/inner-class-handler-memory-leak.html
139 | */
140 | private static class RootResultHandler extends Handler {
141 | private final WeakReference mActivity;
142 |
143 | public RootResultHandler(PrefActivity activity) {
144 | mActivity = new WeakReference(activity);
145 | }
146 |
147 | @Override
148 | public void handleMessage(Message msg) {
149 | PrefActivity activity = mActivity.get();
150 | if (activity != null) {
151 | if (msg.arg1 == 1) {
152 | activity.toggleRootViews(true);
153 | Toast.makeText(activity, "You may need to re-add the widget for this change to take effect", Toast.LENGTH_SHORT).show();
154 | }
155 | else {
156 | // no root access: reset UI
157 | activity.rootPref.setChecked(false);
158 | noRootAccessError(activity);
159 | }
160 | }
161 | }
162 | }
163 |
164 | private final RootResultHandler handler = new RootResultHandler(this);
165 |
166 | private void toggleRootAccess(final boolean enabled) {
167 | if (enabled) {
168 | RootFeatures.checkAccess(new RootFeatures.Listener() {
169 | @Override
170 | public void onFinished(boolean result) {
171 | Message msg = new Message();
172 | msg.arg1 = result ? 1 : 0;
173 | handler.sendMessage(msg);
174 | }
175 | });
176 | }
177 | else {
178 | toggleRootViews(false);
179 | Toast.makeText(PrefActivity.this, "You may need to re-add the widget for this change to take effect", Toast.LENGTH_SHORT).show();
180 | }
181 | }
182 |
183 | private static void noRootAccessError(Context context) {
184 | AlertDialog.Builder builder = new AlertDialog.Builder(context);
185 | builder.setMessage("No root access available!")
186 | .setIcon(android.R.drawable.ic_dialog_alert)
187 | .setTitle("Error")
188 | .setNegativeButton("OK", null);
189 |
190 | AlertDialog alert = builder.create();
191 | alert.show();
192 | }
193 |
194 | private void toggleRootViews(boolean enabled) {
195 | CheckBoxPreference rootQuickUninstall = (CheckBoxPreference)findPreference("rootQuickUninstall");
196 | CheckBoxPreference rootClearCache = (CheckBoxPreference)findPreference("rootClearCache");
197 |
198 | rootQuickUninstall.setEnabled(enabled);
199 | rootClearCache.setEnabled(enabled);
200 |
201 | rootQuickUninstall.setChecked(enabled);
202 | rootClearCache.setChecked(enabled);
203 | }
204 |
205 | private String nameFromValue(String value, Preference preference)
206 | {
207 | String ofTheSpaceCowboy = "";
208 |
209 | String[] values = getResources().getStringArray(R.array.sorting_options_values);
210 | String[] names = getResources().getStringArray(R.array.sorting_options);
211 |
212 | for (int i=0; i < names.length; i++)
213 | {
214 | if(value.equals(values[i]))
215 | {
216 | ofTheSpaceCowboy = names[i];
217 | }
218 | }
219 |
220 | return ofTheSpaceCowboy;
221 | }
222 |
223 | private String intentNameFromValue(String value, Preference preference)
224 | {
225 | String ofTheSpaceCowboy = "";
226 |
227 | String[] values = getResources().getStringArray(R.array.launching_intents_values);
228 | String[] names = getResources().getStringArray(R.array.launching_intents);
229 |
230 | for (int i=0; i < names.length; i++)
231 | {
232 | if(value.equals(values[i]))
233 | {
234 | ofTheSpaceCowboy = names[i];
235 | }
236 | }
237 |
238 | return ofTheSpaceCowboy;
239 | }
240 | }
241 |
--------------------------------------------------------------------------------
/src/com/owentech/DevDrawer/adapters/ActivityListAdapter.java:
--------------------------------------------------------------------------------
1 | package com.owentech.DevDrawer.adapters;
2 |
3 | import android.app.Activity;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.BaseAdapter;
8 | import android.widget.TextView;
9 | import com.owentech.DevDrawer.R;
10 |
11 | import java.util.List;
12 |
13 | /**
14 | * Created with IntelliJ IDEA.
15 | * User: owent
16 | * Date: 06/02/2013
17 | * Time: 16:31
18 | * To change this template use File | Settings | File Templates.
19 | */
20 | public class ActivityListAdapter extends BaseAdapter
21 | {
22 | Activity activity;
23 | List activityList;
24 |
25 | public ActivityListAdapter (Activity activity, List activityList)
26 | {
27 | super();
28 | this.activity = activity;
29 | this.activityList = activityList;
30 | }
31 |
32 | public int getCount()
33 | {
34 | return activityList.size();
35 | }
36 |
37 | public Object getItem(int position)
38 | {
39 | return null;
40 | }
41 |
42 | public long getItemId(int position)
43 | {
44 | return 0;
45 | }
46 |
47 | private class ViewHolder
48 | {
49 | TextView txtActivityPath;
50 | TextView txtActivityName;
51 | }
52 |
53 | public View getView(final int position, View convertView, ViewGroup parent)
54 | {
55 | // Setup the list item text, onclicks etc
56 | ViewHolder holder;
57 | LayoutInflater inflater = activity.getLayoutInflater();
58 |
59 | if(convertView == null)
60 | {
61 | convertView = inflater.inflate(R.layout.activity_choice_list_item, null);
62 | holder = new ViewHolder();
63 |
64 | holder.txtActivityPath = (TextView) convertView.findViewById(R.id.activityPathTextView);
65 | holder.txtActivityName = (TextView) convertView.findViewById(R.id.activityNameTextView);
66 |
67 | convertView.setTag(holder);
68 |
69 | }
70 | else
71 | {
72 | holder = (ViewHolder) convertView.getTag();
73 | }
74 |
75 | holder.txtActivityPath.setText(activityList.get(position).substring(0, activityList.get(position).lastIndexOf('.')));
76 | holder.txtActivityName.setText(activityList.get(position)
77 | .substring(activityList.get(position).lastIndexOf('.'), activityList.get(position).length()));
78 |
79 | // OnClick action for Delete Button
80 |
81 | return convertView;
82 | }
83 |
84 | @Override
85 | public void notifyDataSetChanged()
86 | {
87 | // Database database = new Database(activity);
88 | // packageCollections = database.getAllFiltersInDatabase();
89 |
90 | super.notifyDataSetChanged();
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/src/com/owentech/DevDrawer/adapters/FilterListAdapter.java:
--------------------------------------------------------------------------------
1 | package com.owentech.DevDrawer.adapters;
2 |
3 | /**
4 | * Created with IntelliJ IDEA.
5 | * User: owent
6 | * Date: 29/01/2013
7 | * Time: 16:54
8 | * To change this template use File | Settings | File Templates.
9 | */
10 |
11 | import android.app.Activity;
12 | import android.appwidget.AppWidgetManager;
13 | import android.content.ComponentName;
14 | import android.content.Intent;
15 | import android.os.Build;
16 | import android.os.Bundle;
17 | import android.view.LayoutInflater;
18 | import android.view.View;
19 | import android.view.View.OnClickListener;
20 | import android.view.ViewGroup;
21 | import android.widget.BaseAdapter;
22 | import android.widget.ImageView;
23 | import android.widget.TextView;
24 | import com.owentech.DevDrawer.activities.EditDialog;
25 | import com.owentech.DevDrawer.R;
26 | import com.owentech.DevDrawer.appwidget.DDWidgetProvider;
27 | import com.owentech.DevDrawer.utils.Database;
28 | import com.owentech.DevDrawer.utils.PackageCollection;
29 |
30 | import java.util.List;
31 |
32 | public class FilterListAdapter extends BaseAdapter
33 | {
34 |
35 | Activity activity;
36 | List packageCollections;
37 |
38 | public FilterListAdapter(Activity activity, List packageCollections)
39 | {
40 | super();
41 | this.activity = activity;
42 | this.packageCollections = packageCollections;
43 | }
44 |
45 | public int getCount()
46 | {
47 | return packageCollections.size();
48 | }
49 |
50 | public Object getItem(int position)
51 | {
52 | return null;
53 | }
54 |
55 | public long getItemId(int position)
56 | {
57 | return 0;
58 | }
59 |
60 | private class ViewHolder
61 | {
62 | TextView txtPackageName;
63 | ImageView editButton;
64 | ImageView deleteButton;
65 | }
66 |
67 | public View getView(final int position, View convertView, ViewGroup parent)
68 | {
69 | // Setup the list item text, onclicks etc
70 | ViewHolder holder;
71 | LayoutInflater inflater = activity.getLayoutInflater();
72 |
73 | if(convertView == null)
74 | {
75 | convertView = inflater.inflate(R.layout.package_list_item, null);
76 | holder = new ViewHolder();
77 |
78 | holder.txtPackageName = (TextView) convertView.findViewById(R.id.packageNameTextView);
79 | holder.deleteButton = (ImageView) convertView.findViewById(R.id.deleteImageButton);
80 | holder.editButton = (ImageView) convertView.findViewById(R.id.editImageButton);
81 |
82 | convertView.setTag(holder);
83 |
84 | }
85 | else
86 | {
87 | holder = (ViewHolder) convertView.getTag();
88 | }
89 |
90 | holder.txtPackageName.setText(packageCollections.get(position).mPackageName);
91 |
92 | // OnClick action for Delete Button
93 | holder.deleteButton.setOnClickListener(new OnClickListener()
94 | {
95 |
96 | public void onClick(View view)
97 | {
98 | Database database = new Database(activity);
99 | database.removeFilterFromDatabase(packageCollections.get(position).mId);
100 | database.removeAppFromDatabase(packageCollections.get(position).mId);
101 | notifyDataSetChanged();
102 |
103 | if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
104 | {
105 | AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(activity);
106 | int[] appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(activity, DDWidgetProvider.class));
107 | appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds, R.id.listView);
108 | }
109 |
110 | }
111 |
112 | });
113 |
114 | // OnClick action for Edit Button
115 | holder.editButton.setOnClickListener(new OnClickListener()
116 | {
117 |
118 | public void onClick(View view)
119 | {
120 | Intent intent = new Intent(activity, EditDialog.class);
121 | Bundle bundle = new Bundle();
122 | bundle.putString("text", packageCollections.get(position).mPackageName);
123 | bundle.putString("id", packageCollections.get(position).mId);
124 | intent.putExtras(bundle);
125 |
126 | activity.startActivityForResult(intent, 0);
127 | }
128 |
129 | });
130 |
131 | return convertView;
132 | }
133 |
134 | @Override
135 | public void notifyDataSetChanged()
136 | {
137 | Database database = new Database(activity);
138 | packageCollections = database.getAllFiltersInDatabase();
139 |
140 | super.notifyDataSetChanged();
141 | }
142 | }
--------------------------------------------------------------------------------
/src/com/owentech/DevDrawer/adapters/LegacyListAdapter.java:
--------------------------------------------------------------------------------
1 | package com.owentech.DevDrawer.adapters;
2 |
3 | import android.app.Activity;
4 | import android.content.SharedPreferences;
5 | import android.content.pm.ApplicationInfo;
6 | import android.content.pm.PackageManager;
7 | import android.graphics.Bitmap;
8 | import android.graphics.drawable.BitmapDrawable;
9 | import android.graphics.drawable.Drawable;
10 | import android.preference.PreferenceManager;
11 | import android.view.LayoutInflater;
12 | import android.view.View;
13 | import android.view.ViewGroup;
14 | import android.widget.BaseAdapter;
15 | import android.widget.Button;
16 | import android.widget.ImageView;
17 | import android.widget.TextView;
18 | import com.owentech.DevDrawer.R;
19 | import com.owentech.DevDrawer.activities.ClickHandlingActivity;
20 | import com.owentech.DevDrawer.utils.Database;
21 |
22 | import java.util.ArrayList;
23 | import java.util.List;
24 |
25 | public class LegacyListAdapter extends BaseAdapter
26 | {
27 | PackageManager pm;
28 |
29 | public List applicationNames;
30 | public List packageNames;
31 | public List applicationIcons;
32 |
33 | Activity activity;
34 | Database database;
35 | SharedPreferences sp;
36 | boolean rootClearCache;
37 |
38 | public LegacyListAdapter (Activity activity)
39 | {
40 | super();
41 | this.activity = activity;
42 | database = new Database(activity);
43 | getApps();
44 | notifyDataSetChanged();
45 | sp = PreferenceManager.getDefaultSharedPreferences(activity);
46 | rootClearCache = sp.getBoolean("rootClearCache", false);
47 | }
48 |
49 | public int getCount()
50 | {
51 | return applicationNames.size();
52 | }
53 |
54 | public Object getItem(int position)
55 | {
56 | return null;
57 | }
58 |
59 | public long getItemId(int position)
60 | {
61 | return 0;
62 | }
63 |
64 | private class ViewHolder
65 | {
66 | ImageView icon;
67 | TextView packageName;
68 | TextView appName;
69 | ImageView delete;
70 | ImageView settings;
71 | ImageView clear;
72 | ImageView more;
73 | Button touchArea;
74 | }
75 |
76 | public View getView(final int position, View convertView, ViewGroup parent)
77 | {
78 | ViewHolder holder;
79 | final LayoutInflater inflater = activity.getLayoutInflater();
80 |
81 | if(convertView == null)
82 | {
83 | convertView = inflater.inflate(rootClearCache ? R.layout.list_item_more_legacy : R.layout.list_item, null);
84 | holder = new ViewHolder();
85 |
86 | holder.icon = (ImageView) convertView.findViewById(R.id.imageView);
87 | holder.packageName = (TextView) convertView.findViewById(R.id.packageNameTextView);
88 | holder.appName = (TextView) convertView.findViewById(R.id.appNameTextView);
89 | holder.delete = (ImageView) convertView.findViewById(R.id.uninstallImageButton);
90 | holder.settings = (ImageView) convertView.findViewById(R.id.appDetailsImageButton);
91 | holder.clear = (ImageView) convertView.findViewById(R.id.clearImageButton);
92 | holder.more = (ImageView) convertView.findViewById(R.id.moreImageButton);
93 | holder.touchArea = (Button) convertView.findViewById(R.id.touchArea);
94 |
95 | convertView.setTag(holder);
96 |
97 | }
98 | else
99 | {
100 | holder = (ViewHolder) convertView.getTag();
101 | }
102 |
103 | holder.icon.setImageBitmap(convertFromDrawable(applicationIcons.get(position)));
104 | holder.packageName.setText(packageNames.get(position));
105 | holder.appName.setText(applicationNames.get(position));
106 |
107 | if(sp.getString("theme", "Light").equals("Light"))
108 | {
109 | holder.appName.setTextColor(activity.getResources().getColor(R.color.app_name_light));
110 | if (holder.delete != null) holder.delete.setImageResource(R.drawable.delete_imageview);
111 | if (holder.settings != null) holder.settings.setImageResource(R.drawable.settings_imageview);
112 | if (holder.clear != null) holder.clear.setImageResource(R.drawable.clear_imageview);
113 | if (holder.more != null) holder.more.setImageResource(R.drawable.more_imageview);
114 | }
115 | else
116 | {
117 | holder.appName.setTextColor(activity.getResources().getColor(R.color.app_name_dark));
118 | if (holder.delete != null) holder.delete.setImageResource(R.drawable.delete_imageview_dark);
119 | if (holder.settings != null) holder.settings.setImageResource(R.drawable.settings_imageview_dark);
120 | if (holder.clear != null) holder.clear.setImageResource(R.drawable.clear_imageview_dark);
121 | if (holder.more != null) holder.more.setImageResource(R.drawable.more_imageview_dark);
122 | }
123 |
124 | if (holder.delete != null) holder.delete.setOnClickListener(new View.OnClickListener()
125 | {
126 | @Override
127 | public void onClick(View view)
128 | {
129 | ClickHandlingActivity.startUninstall(activity, packageNames.get(position));
130 | }
131 | });
132 |
133 | if (holder.settings != null) holder.settings.setOnClickListener(new View.OnClickListener()
134 | {
135 | @Override
136 | public void onClick(View view)
137 | {
138 | ClickHandlingActivity.startAppDetails(activity, packageNames.get(position));
139 | }
140 | });
141 |
142 | if (holder.clear != null) holder.clear.setOnClickListener(new View.OnClickListener()
143 | {
144 | @Override
145 | public void onClick(View view)
146 | {
147 | ClickHandlingActivity.startClearCache(activity, packageNames.get(position));
148 | }
149 | });
150 |
151 | if (holder.more != null) holder.more.setOnClickListener(new View.OnClickListener()
152 | {
153 | @Override
154 | public void onClick(View view)
155 | {
156 | ClickHandlingActivity.startMoreOverflowMenu(activity, packageNames.get(position));
157 | }
158 | });
159 |
160 | holder.touchArea.setOnClickListener(new View.OnClickListener()
161 | {
162 | @Override
163 | public void onClick(View view)
164 | {
165 | ClickHandlingActivity.startApp(activity, packageNames.get(position));
166 | }
167 | });
168 |
169 | return convertView;
170 | }
171 |
172 | @Override
173 | public void notifyDataSetChanged()
174 | {
175 | super.notifyDataSetChanged();
176 | }
177 |
178 | // Method to get all apps from the app database and add to the dataset
179 | public void getApps()
180 | {
181 |
182 | SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(activity);
183 |
184 | // Get all apps from the app table
185 | String[] packages = database.getAllAppsInDatabase(sp.getString("widgetSorting", "added"));
186 | pm = activity.getPackageManager();
187 |
188 | // Defensive code, was getting some strange behaviour and forcing the lists seems to fix
189 | applicationNames = null;
190 | packageNames = null;
191 | applicationIcons = null;
192 |
193 | // Setup the lists holding the data
194 | applicationNames = new ArrayList();
195 | packageNames = new ArrayList();
196 | applicationIcons = new ArrayList();
197 |
198 | // Loop though adding details from PackageManager to the lists
199 | for(String s : packages)
200 | {
201 | ApplicationInfo applicationInfo;
202 |
203 | try {
204 | applicationInfo = pm.getPackageInfo(s, PackageManager.GET_ACTIVITIES).applicationInfo;
205 | applicationNames.add(applicationInfo.loadLabel(pm).toString());
206 | packageNames.add(applicationInfo.packageName.toString());
207 | applicationIcons.add(applicationInfo.loadIcon(pm));
208 |
209 | } catch (PackageManager.NameNotFoundException e) {
210 | e.printStackTrace();
211 | }
212 | }
213 |
214 | }
215 |
216 | // Method to return a bitmap from drawable
217 | public Bitmap convertFromDrawable(Drawable d)
218 | {
219 | return ((BitmapDrawable)d).getBitmap();
220 | }
221 | }
222 |
--------------------------------------------------------------------------------
/src/com/owentech/DevDrawer/adapters/LocaleListAdapter.java:
--------------------------------------------------------------------------------
1 | package com.owentech.DevDrawer.adapters;
2 |
3 | import android.app.Activity;
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 | import com.owentech.DevDrawer.R;
11 | import com.owentech.DevDrawer.utils.Database;
12 |
13 | import java.util.ArrayList;
14 | import java.util.List;
15 |
16 | /**
17 | * Created with IntelliJ IDEA.
18 | * User: owent
19 | * Date: 07/05/2013
20 | * Time: 16:39
21 | * To change this template use File | Settings | File Templates.
22 | */
23 | public class LocaleListAdapter extends BaseAdapter
24 | {
25 |
26 | Activity activity;
27 | List localeList;
28 | Database database;
29 |
30 | public LocaleListAdapter(Activity activity)
31 | {
32 | this.activity = activity;
33 | database = new Database(activity);
34 | localeList = new ArrayList();
35 | localeList.addAll(database.getLocales());
36 | notifyDataSetChanged();
37 | }
38 |
39 |
40 | @Override
41 | public int getCount()
42 | {
43 | return localeList.size();
44 | }
45 |
46 | @Override
47 | public Object getItem(int position)
48 | {
49 | return localeList.get(position);
50 | }
51 |
52 | @Override
53 | public long getItemId(int position)
54 | {
55 | return position;
56 | }
57 |
58 | private class ViewHolder
59 | {
60 | TextView localeTextView;
61 | ImageView delete;
62 | }
63 |
64 | @Override
65 | public View getView(final int position, View convertView, ViewGroup viewGroup)
66 | {
67 | ViewHolder holder;
68 | LayoutInflater inflater = activity.getLayoutInflater();
69 |
70 | if(convertView == null)
71 | {
72 | convertView = inflater.inflate(R.layout.locale_list_item, null);
73 | holder = new ViewHolder();
74 |
75 | holder.localeTextView = (TextView) convertView.findViewById(R.id.localeTextView);
76 | holder.delete = (ImageView) convertView.findViewById(R.id.deleteImageButton);
77 | convertView.setTag(holder);
78 |
79 | }
80 | else
81 | {
82 | holder = (ViewHolder) convertView.getTag();
83 | }
84 |
85 | holder.localeTextView.setText(localeList.get(position));
86 |
87 | holder.delete.setOnClickListener(new View.OnClickListener()
88 | {
89 | @Override
90 | public void onClick(View view)
91 | {
92 | database.deleteLocale(localeList.get(position));
93 | notifyDataSetChanged();
94 | }
95 | });
96 |
97 | return convertView;
98 | }
99 |
100 | @Override
101 | public void notifyDataSetChanged()
102 | {
103 | localeList = null;
104 | localeList = new ArrayList();
105 | localeList.addAll(database.getLocales());
106 | super.notifyDataSetChanged();
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/src/com/owentech/DevDrawer/adapters/PartialMatchAdapter.java:
--------------------------------------------------------------------------------
1 | package com.owentech.DevDrawer.adapters;
2 |
3 | import android.app.Activity;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.*;
8 | import com.owentech.DevDrawer.R;
9 |
10 | import java.util.ArrayList;
11 | import java.util.List;
12 |
13 | /**
14 | * Created with IntelliJ IDEA.
15 | * User: owent
16 | * Date: 07/05/2013
17 | * Time: 08:15
18 | * To change this template use File | Settings | File Templates.
19 | */
20 | public class PartialMatchAdapter extends BaseAdapter implements Filterable
21 | {
22 |
23 | Activity activity;
24 | List items;
25 | List filteredItems;
26 | Filter filter;
27 |
28 | public PartialMatchAdapter(Activity activity, List items)
29 | {
30 | this.activity = activity;
31 | this.items = items;
32 | }
33 |
34 | @Override
35 | public int getCount()
36 | {
37 | return filteredItems.size();
38 | }
39 |
40 | @Override
41 | public Object getItem(int position)
42 | {
43 | return filteredItems.get(position);
44 | }
45 |
46 | @Override
47 | public long getItemId(int i)
48 | {
49 | return i;
50 | }
51 |
52 | class ViewHolder
53 | {
54 | TextView textView;
55 | }
56 |
57 | @Override
58 | public View getView(int position, View convertView, ViewGroup viewGroup)
59 | {
60 |
61 | // Setup the list item text, onclicks etc
62 | try
63 | {
64 | ViewHolder holder;
65 | LayoutInflater inflater = activity.getLayoutInflater();
66 |
67 | if(convertView == null)
68 | {
69 | convertView = inflater.inflate(R.layout.dropdown_list_item, null);
70 | holder = new ViewHolder();
71 |
72 | holder.textView = (TextView) convertView.findViewById(android.R.id.text1);
73 | convertView.setTag(holder);
74 |
75 | }
76 | else
77 | {
78 | holder = (ViewHolder) convertView.getTag();
79 | }
80 |
81 | holder.textView.setText(filteredItems.get(position));
82 | }
83 | catch(Exception e)
84 | {
85 | return null;
86 | }
87 |
88 | return convertView;
89 | }
90 |
91 | @Override
92 | public Filter getFilter()
93 | {
94 | if (filter == null)
95 | {
96 |
97 | filter = new Filter()
98 | {
99 | @Override
100 | protected FilterResults performFiltering(CharSequence charSequence)
101 | {
102 |
103 | filteredItems = new ArrayList();
104 | if(charSequence != null){
105 | for (String item : items)
106 | {
107 | if (item.toLowerCase().contains(charSequence.toString().toLowerCase()))
108 | {
109 | filteredItems.add(item);
110 | }
111 | }
112 | }
113 |
114 | FilterResults filterResults = new FilterResults();
115 | filterResults.count = filteredItems.size();
116 | filterResults.values = filteredItems;
117 | return filterResults;
118 | }
119 |
120 | @Override
121 | protected void publishResults(CharSequence charSequence, FilterResults filterResults)
122 | {
123 | notifyDataSetChanged();
124 | }
125 | };
126 |
127 | }
128 |
129 | return filter;
130 | }
131 | }
132 |
--------------------------------------------------------------------------------
/src/com/owentech/DevDrawer/appwidget/DDWidgetProvider.java:
--------------------------------------------------------------------------------
1 | package com.owentech.DevDrawer.appwidget;
2 |
3 | /**
4 | * Created with IntelliJ IDEA.
5 | * User: owent
6 | * Date: 25/01/2013
7 | * Time: 19:23
8 | * To change this template use File | Settings | File Templates.
9 | */
10 |
11 | import android.app.PendingIntent;
12 | import android.appwidget.AppWidgetManager;
13 | import android.appwidget.AppWidgetProvider;
14 | import android.content.Context;
15 | import android.content.Intent;
16 | import android.content.SharedPreferences;
17 | import android.net.Uri;
18 | import android.preference.PreferenceManager;
19 | import android.widget.RemoteViews;
20 | import com.owentech.DevDrawer.activities.ClickHandlingActivity;
21 | import com.owentech.DevDrawer.R;
22 |
23 | public class DDWidgetProvider extends AppWidgetProvider {
24 |
25 | public static String PACKAGE_STRING = "default.package";
26 |
27 | @Override
28 | public void onUpdate(Context context, AppWidgetManager appWidgetManager,
29 | int[] appWidgetIds)
30 | {
31 |
32 | for (int i=0; i list;
34 |
35 | public List applicationNames;
36 | public List packageNames;
37 | public List applicationIcons;
38 |
39 | public DDWidgetViewsFactory(Context context, Intent intent) {
40 | this.context = context;
41 | appWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,
42 | AppWidgetManager.INVALID_APPWIDGET_ID);
43 |
44 | // Create the database tables
45 | database = new Database(context);
46 | database.createTables();
47 |
48 | onDataSetChanged();
49 |
50 | }
51 |
52 | @Override
53 | public void onCreate() {
54 | // Nothing yet
55 | }
56 |
57 | @Override
58 | public void onDestroy() {
59 | // Nothing yet
60 | }
61 |
62 | @Override
63 | public int getCount() {
64 | return applicationNames.size();
65 | }
66 |
67 | @Override
68 | public RemoteViews getViewAt(int position) {
69 |
70 | SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
71 | boolean rootClearCache = sp.getBoolean("rootClearCache", false);
72 |
73 | // Setup the list item and intents for on click
74 | RemoteViews row = new RemoteViews(context.getPackageName(),
75 | rootClearCache ?
76 | R.layout.list_item_more :
77 | R.layout.list_item);
78 |
79 | try
80 | {
81 | row.setTextViewText(R.id.packageNameTextView, packageNames.get(position));
82 | row.setTextViewText(R.id.appNameTextView, applicationNames.get(position));
83 | row.setImageViewBitmap(R.id.imageView, convertFromDrawable(applicationIcons.get(position)));
84 |
85 | if(sp.getString("theme", "Light").equals("Light"))
86 | {
87 | row.setTextColor(R.id.appNameTextView, context.getResources().getColor(R.color.app_name_light));
88 | row.setImageViewResource(R.id.appDetailsImageButton, R.drawable.settings_imageview);
89 | row.setImageViewResource(R.id.uninstallImageButton, R.drawable.delete_imageview);
90 | row.setImageViewResource(R.id.clearImageButton, R.drawable.clear_imageview);
91 | row.setImageViewResource(R.id.moreImageButton, R.drawable.more_imageview);
92 | }
93 | else
94 | {
95 | row.setTextColor(R.id.appNameTextView, context.getResources().getColor(R.color.app_name_dark));
96 | row.setImageViewResource(R.id.appDetailsImageButton, R.drawable.settings_imageview_dark);
97 | row.setImageViewResource(R.id.uninstallImageButton, R.drawable.delete_imageview_dark);
98 | row.setImageViewResource(R.id.clearImageButton, R.drawable.clear_imageview_dark);
99 | row.setImageViewResource(R.id.moreImageButton, R.drawable.more_imageview_dark);
100 | }
101 |
102 | row.setViewVisibility(R.id.clearImageButton, rootClearCache ? View.VISIBLE : View.GONE);
103 |
104 | Intent appDetailsClickIntent=new Intent();
105 | Bundle appDetailsClickExtras=new Bundle();
106 | //appDetailsClickExtras.putBoolean("appDetails", true);
107 | appDetailsClickExtras.putInt("launchType", Constants.LAUNCH_APP_DETAILS);
108 | appDetailsClickExtras.putString(DDWidgetProvider.PACKAGE_STRING, packageNames.get(position));
109 | appDetailsClickIntent.putExtras(appDetailsClickExtras);
110 | row.setOnClickFillInIntent(R.id.appDetailsImageButton, appDetailsClickIntent);
111 |
112 | Intent uninstallClickIntent=new Intent();
113 | Bundle uninstallClickExtras=new Bundle();
114 | //appDetailsClickExtras.putBoolean("appDetails", true);
115 | uninstallClickExtras.putInt("launchType", Constants.LAUNCH_UNINSTALL);
116 | uninstallClickExtras.putString(DDWidgetProvider.PACKAGE_STRING, packageNames.get(position));
117 | uninstallClickIntent.putExtras(uninstallClickExtras);
118 | row.setOnClickFillInIntent(R.id.uninstallImageButton, uninstallClickIntent);
119 |
120 | Intent clearClickIntent=new Intent();
121 | Bundle clearClickExtras=new Bundle();
122 | clearClickExtras.putInt("launchType", Constants.LAUNCH_CLEAR);
123 | clearClickExtras.putString(DDWidgetProvider.PACKAGE_STRING, packageNames.get(position));
124 | clearClickIntent.putExtras(clearClickExtras);
125 | row.setOnClickFillInIntent(R.id.clearImageButton, clearClickIntent);
126 |
127 | Intent moreClickIntent=new Intent();
128 | Bundle moreClickExtras=new Bundle();
129 | moreClickExtras.putInt("launchType", Constants.LAUNCH_MORE);
130 | moreClickExtras.putString(DDWidgetProvider.PACKAGE_STRING, packageNames.get(position));
131 | moreClickIntent.putExtras(moreClickExtras);
132 | row.setOnClickFillInIntent(R.id.moreImageButton, moreClickIntent);
133 |
134 | Intent rowClickIntent=new Intent();
135 | Bundle rowClickExtras=new Bundle();
136 | //rowClickExtras.putBoolean("appDetails", false);
137 | rowClickExtras.putInt("launchType", Constants.LAUNCH_APP);
138 | rowClickExtras.putString(DDWidgetProvider.PACKAGE_STRING, packageNames.get(position));
139 | rowClickIntent.putExtras(rowClickExtras);
140 | row.setOnClickFillInIntent(R.id.touchArea, rowClickIntent);
141 |
142 | return(row);
143 | }
144 | catch (IndexOutOfBoundsException e)
145 | {
146 | return null;
147 | }
148 | }
149 |
150 | @Override
151 | public RemoteViews getLoadingView() {
152 | return(null);
153 | }
154 |
155 | @Override
156 | public int getViewTypeCount() {
157 | return(1);
158 | }
159 |
160 | @Override
161 | public long getItemId(int position) {
162 | return(position);
163 | }
164 |
165 | @Override
166 | public boolean hasStableIds() {
167 | return(true);
168 | }
169 |
170 | @Override
171 | public void onDataSetChanged() {
172 | // Update the dataset
173 | getApps();
174 | }
175 |
176 | // Method to get all apps from the app database and add to the dataset
177 | public void getApps()
178 | {
179 |
180 | SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
181 |
182 | // Get all apps from the app table
183 | String[] packages = database.getAllAppsInDatabase(sp.getString("widgetSorting", "added"));
184 | pm = context.getPackageManager();
185 |
186 | // Defensive code, was getting some strange behaviour and forcing the lists seems to fix
187 | applicationNames = null;
188 | packageNames = null;
189 | applicationIcons = null;
190 |
191 | // Setup the lists holding the data
192 | applicationNames = new ArrayList();
193 | packageNames = new ArrayList();
194 | applicationIcons = new ArrayList();
195 |
196 | // Loop though adding details from PackageManager to the lists
197 | for(String s : packages)
198 | {
199 | Log.d("DDWidgetViewsFactory", "String is: " + s);
200 | ApplicationInfo applicationInfo;
201 |
202 | try {
203 | applicationInfo = pm.getPackageInfo(s, PackageManager.GET_ACTIVITIES).applicationInfo;
204 | applicationNames.add(applicationInfo.loadLabel(pm).toString());
205 | packageNames.add(applicationInfo.packageName.toString());
206 | applicationIcons.add(applicationInfo.loadIcon(pm));
207 |
208 | } catch (PackageManager.NameNotFoundException e) {
209 | e.printStackTrace();
210 | }
211 | }
212 |
213 | }
214 |
215 | // Method to return a bitmap from drawable
216 | public Bitmap convertFromDrawable(Drawable d)
217 | {
218 | return ((BitmapDrawable)d).getBitmap();
219 | }
220 | }
221 |
--------------------------------------------------------------------------------
/src/com/owentech/DevDrawer/receivers/AppInstalledReceiver.java:
--------------------------------------------------------------------------------
1 | package com.owentech.DevDrawer.receivers;
2 |
3 | import android.appwidget.AppWidgetManager;
4 | import android.content.BroadcastReceiver;
5 | import android.content.ComponentName;
6 | import android.content.Context;
7 | import android.content.Intent;
8 | import android.os.Build;
9 | import android.util.Log;
10 | import com.owentech.DevDrawer.appwidget.DDWidgetProvider;
11 | import com.owentech.DevDrawer.utils.Database;
12 | import com.owentech.DevDrawer.R;
13 |
14 | /**
15 | * Created with IntelliJ IDEA.
16 | * User: owent
17 | * Date: 25/01/2013
18 | * Time: 19:33
19 | * To change this template use File | Settings | File Templates.
20 | */
21 |
22 | public class AppInstalledReceiver extends BroadcastReceiver {
23 |
24 | Database database;
25 | public static String TAG = "DevDrawer-AppInstalledReceiver";
26 |
27 | @Override
28 | public void onReceive(Context context, Intent intent) {
29 |
30 | // New app has been installed, check and add to the database / widget
31 | String newPackage = intent.getData().getSchemeSpecificPart();
32 |
33 | database = new Database(context);
34 | database.createTables();
35 |
36 | if(database.getFiltersCount() != 0)
37 | {
38 | int match = database.parseAndMatch(newPackage);
39 | if(match != Database.NOT_FOUND)
40 | {
41 | Log.d(TAG, "Matches Filter");
42 | database.addAppToDatabase(intent.getData().getSchemeSpecificPart(), Integer.toString(match));
43 |
44 | if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
45 | {
46 | AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
47 | int[] appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(context, DDWidgetProvider.class));
48 | appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds, R.id.listView);
49 | }
50 | }
51 | else
52 | {
53 | Log.d(TAG, "Doesn't Match Filter");
54 | }
55 |
56 | }
57 |
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/com/owentech/DevDrawer/receivers/AppUninstalledReceiver.java:
--------------------------------------------------------------------------------
1 | package com.owentech.DevDrawer.receivers;
2 |
3 | import android.appwidget.AppWidgetManager;
4 | import android.content.BroadcastReceiver;
5 | import android.content.ComponentName;
6 | import android.content.Context;
7 | import android.content.Intent;
8 | import android.os.Build;
9 | import android.util.Log;
10 | import com.owentech.DevDrawer.R;
11 | import com.owentech.DevDrawer.appwidget.DDWidgetProvider;
12 | import com.owentech.DevDrawer.utils.Database;
13 |
14 | /**
15 | * Created with IntelliJ IDEA.
16 | * User: owent
17 | * Date: 31/01/2013
18 | * Time: 16:30
19 | * To change this template use File | Settings | File Templates.
20 | */
21 | public class AppUninstalledReceiver extends BroadcastReceiver
22 | {
23 |
24 | Database database;
25 | public static String TAG = "DevDrawer-AppUninstalledReceiver";
26 |
27 | @Override
28 | public void onReceive(Context context, Intent intent)
29 | {
30 | // App has been removed, if it is in the app table remove from the widget
31 | String uninstalledPackage = intent.getData().getSchemeSpecificPart();
32 |
33 | database = new Database(context);
34 | database.createTables();
35 |
36 | if(database.getAppsCount() != 0)
37 | {
38 |
39 | if(database.doesAppExistInDb(uninstalledPackage))
40 | {
41 | Log.d(TAG, "App Exists");
42 | database.deleteAppFromDb(uninstalledPackage);
43 |
44 | if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
45 | {
46 | AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
47 | int[] appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(context, DDWidgetProvider.class));
48 | appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds, R.id.listView);
49 | }
50 | }
51 | else
52 | {
53 | Log.d(TAG, "App Doesn't Exist");
54 | }
55 |
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/com/owentech/DevDrawer/utils/AddAllAppsAsync.java:
--------------------------------------------------------------------------------
1 | package com.owentech.DevDrawer.utils;
2 |
3 | import android.app.ProgressDialog;
4 | import android.appwidget.AppWidgetManager;
5 | import android.content.ComponentName;
6 | import android.content.Context;
7 | import android.content.Intent;
8 | import android.content.pm.PackageManager;
9 | import android.content.pm.ResolveInfo;
10 | import android.os.AsyncTask;
11 | import android.os.Build;
12 | import com.owentech.DevDrawer.R;
13 | import com.owentech.DevDrawer.appwidget.DDWidgetProvider;
14 |
15 | import java.util.ArrayList;
16 | import java.util.List;
17 |
18 | /**
19 | * Created with IntelliJ IDEA.
20 | * User: tony
21 | * Date: 03/02/13
22 | * Time: 20:34
23 | * To change this template use File | Settings | File Templates.
24 | */
25 | public class AddAllAppsAsync extends AsyncTask
26 | {
27 | ProgressDialog progressDialog;
28 | Context context;
29 | Database database;
30 | String newFilter;
31 |
32 | public AddAllAppsAsync(Context context, String newFilter)
33 | {
34 | this.context = context;
35 | this.newFilter = newFilter;
36 | progressDialog = new ProgressDialog(context);
37 | }
38 |
39 | @Override
40 | protected Object doInBackground(Object... objects)
41 | {
42 | getAllAppsInstalledAndAdd(newFilter);
43 | return null;
44 | }
45 |
46 | // Method to check existing installed apps and add to apps table if they match the filter
47 | public void getAllAppsInstalledAndAdd(String newFilter)
48 | {
49 |
50 | List appPackages = new ArrayList();
51 | PackageManager pm;
52 | List list;
53 |
54 | database = new Database(context);
55 |
56 | // get installed applications
57 | pm = context.getPackageManager();
58 | Intent intent = new Intent(Intent.ACTION_MAIN, null);
59 | intent.addCategory(Intent.CATEGORY_LAUNCHER);
60 | list = pm.queryIntentActivities(intent,
61 | PackageManager.PERMISSION_GRANTED);
62 |
63 | // Loop through the installed apps and check if they match the new filter
64 | for (ResolveInfo rInfo : list)
65 | {
66 |
67 | String currentPackage = rInfo.activityInfo.applicationInfo.packageName.toLowerCase();
68 |
69 | if (newFilter.contains("*"))
70 | {
71 | if (currentPackage.toLowerCase().startsWith(newFilter.toLowerCase().substring(0, newFilter.indexOf("*"))))
72 | appPackages.add(currentPackage);
73 |
74 | }
75 | else
76 | {
77 | if (currentPackage.toLowerCase().equals(newFilter.toLowerCase()))
78 | appPackages.add(currentPackage);
79 |
80 | }
81 |
82 | }
83 |
84 | // If the list is > 0 add the packages to the database
85 | if(appPackages.size() != 0)
86 | {
87 | for (String s : appPackages)
88 | {
89 | List packageCollections = database.getAllFiltersInDatabase();
90 |
91 | database.addAppToDatabase(s, packageCollections.get(packageCollections.size()-1).mId);
92 |
93 | if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
94 | {
95 | AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
96 | int[] appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(context, DDWidgetProvider.class));
97 | appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds, R.id.listView);
98 | }
99 | }
100 | }
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/src/com/owentech/DevDrawer/utils/Constants.java:
--------------------------------------------------------------------------------
1 | package com.owentech.DevDrawer.utils;
2 |
3 | /**
4 | * Created with IntelliJ IDEA.
5 | * User: owent
6 | * Date: 31/01/2013
7 | * Time: 21:13
8 | * To change this template use File | Settings | File Templates.
9 | */
10 | public class Constants
11 | {
12 |
13 | public static int EDIT_DIALOG_CHANGE = 1;
14 | public static int EDIT_DIALOG_CANCEL = 2;
15 |
16 | public static final int LAUNCH_APP = 1;
17 | public static final int LAUNCH_APP_DETAILS = 2;
18 | public static final int LAUNCH_UNINSTALL = 3;
19 | public static final int LAUNCH_CLEAR = 4;
20 | public static final int LAUNCH_MORE = 5;
21 |
22 | public static final String ORDER_ORIGINAL = "added";
23 | public static final String ORDER_ALPHABETICAL = "alphabetically";
24 |
25 | public static final int MENU_SHORTCUT = 0;
26 | public static final int MENU_SETTINGS = 1;
27 | public static final int MENU_LOCALE_SWITCHER = 2;
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/com/owentech/DevDrawer/utils/Database.java:
--------------------------------------------------------------------------------
1 | package com.owentech.DevDrawer.utils;
2 |
3 | import android.content.Context;
4 | import android.database.Cursor;
5 | import android.database.sqlite.SQLiteDatabase;
6 | import android.util.Log;
7 |
8 | import java.util.*;
9 |
10 | /**
11 | * Created with IntelliJ IDEA.
12 | * User: owent
13 | * Date: 29/01/2013
14 | * Time: 07:08
15 | * To change this template use File | Settings | File Templates.
16 | */
17 | public class Database {
18 |
19 | SQLiteDatabase db;
20 | Context ctx;
21 |
22 | public static int NOT_FOUND = 1000000;
23 |
24 | private static final String TAG = "DevDrawer-Database";
25 |
26 | public Database(Context ctx)
27 | {
28 | this.ctx = ctx;
29 | }
30 |
31 | ///////////////////////////////////
32 | // Method to connect to database
33 | ///////////////////////////////////
34 | public void connectDB()
35 | {
36 | db = ctx.openOrCreateDatabase("DevDrawer.db",
37 | SQLiteDatabase.CREATE_IF_NECESSARY, null);
38 | }
39 |
40 | ////////////////////////////////////////
41 | // Method to close database connection
42 | ////////////////////////////////////////
43 | public void closeDB()
44 | {
45 | db.close();
46 | }
47 |
48 | /////////////////////////////////////////
49 | // Method to create tables in database
50 | /////////////////////////////////////////
51 | public void createTables()
52 | {
53 | connectDB();
54 |
55 | // create tables
56 | String CREATE_TABLE_FILTER = "CREATE TABLE IF NOT EXISTS devdrawer_filter ("
57 | + "id INTEGER PRIMARY KEY, package TEXT);";
58 | db.execSQL(CREATE_TABLE_FILTER);
59 |
60 | String CREATE_TABLE_APPS = "CREATE TABLE IF NOT EXISTS devdrawer_app ("
61 | + "id INTEGER PRIMARY KEY, package TEXT, filterid INTEGER);";
62 | db.execSQL(CREATE_TABLE_APPS);
63 |
64 | String CREATE_TABLE_LOCALES = "CREATE TABLE IF NOT EXISTS devdrawer_locales ("
65 | + "name TEXT);";
66 | db.execSQL(CREATE_TABLE_LOCALES);
67 |
68 | closeDB();
69 |
70 | }
71 |
72 | // ////////////////////////////////////////////////
73 | // Method to add an entry into the filter table
74 | // ///////////////////////////////////////////////
75 | public void addFilterToDatabase(String p)
76 | {
77 | // connect
78 | connectDB();
79 |
80 | // add accident entry
81 | String packageInsertQuery = "INSERT INTO 'devdrawer_filter' "
82 | + "(package)" + "VALUES" + "('" + p + "');";
83 |
84 | db.execSQL(packageInsertQuery);
85 |
86 |
87 |
88 | // close
89 | closeDB();
90 | }
91 |
92 | // ///////////////////////////////////////////////
93 | // Method to add package to installed apps table
94 | // ///////////////////////////////////////////////
95 | public void addAppToDatabase(String p, String filterId)
96 | {
97 | // connect
98 | connectDB();
99 |
100 | // add accident entry
101 | String packageInsertQuery = "INSERT INTO 'devdrawer_app' "
102 | + "(package, filterid)" + "VALUES" + "('" + p + "', " + filterId + ");";
103 |
104 | db.execSQL(packageInsertQuery);
105 |
106 | // close
107 | closeDB();
108 | }
109 |
110 | // ////////////////////////////////////////////////////
111 | // Method to remove an entry from the filters tables
112 | // ////////////////////////////////////////////////////
113 | public void removeFilterFromDatabase(String i)
114 | {
115 | // connect
116 | connectDB();
117 |
118 | // add accident entry
119 | String packageDeleteQuery = "DELETE FROM 'devdrawer_filter' WHERE id = '" + i + "'";
120 |
121 | db.execSQL(packageDeleteQuery);
122 |
123 | // close
124 | closeDB();
125 | }
126 |
127 | // ////////////////////////////////////////////////////
128 | // Method to remove an entry from the filters tables
129 | // ////////////////////////////////////////////////////
130 | public void removeAppFromDatabase(String i)
131 | {
132 | // connect
133 | connectDB();
134 |
135 | // add accident entry
136 | String packageDeleteQuery = "DELETE FROM 'devdrawer_app' WHERE filterid = '" + i + "'";
137 |
138 | db.execSQL(packageDeleteQuery);
139 |
140 | // close
141 | closeDB();
142 | }
143 |
144 | //////////////////////////////////////////////////////
145 | // Method to get all the entries in the filter table
146 | //////////////////////////////////////////////////////
147 | public List getAllFiltersInDatabase()
148 | {
149 |
150 | connectDB();
151 |
152 | Cursor getAllCursor = db.query("devdrawer_filter", null, null, null, null, null, null, null);
153 |
154 | List packageCollections = new ArrayList();
155 |
156 | getAllCursor.moveToFirst();
157 |
158 | while(!getAllCursor.isAfterLast())
159 | {
160 |
161 | packageCollections.add(new PackageCollection(getAllCursor.getString(0), getAllCursor.getString(1)));
162 | getAllCursor.moveToNext();
163 | }
164 |
165 | getAllCursor.close();
166 | closeDB();
167 |
168 | return packageCollections;
169 |
170 | }
171 |
172 | ////////////////////////////////////////////////////////////////
173 | // Method to get all the packages in the installed apps table
174 | ////////////////////////////////////////////////////////////////
175 | public String[] getAllAppsInDatabase(String order)
176 | {
177 | String[] packages;
178 |
179 | connectDB();
180 |
181 | Cursor getAllCursor = db.query("devdrawer_app", null, null, null, null, null,
182 | (order.equals(Constants.ORDER_ORIGINAL)) ? null : "package ASC",
183 | null);
184 |
185 | Log.d("DATABASE", "getAllAppsInDatabase: " + Integer.toString(getAllCursor.getCount()) );
186 |
187 | getAllCursor.moveToFirst();
188 |
189 | packages = new String[getAllCursor.getCount()];
190 |
191 | int i=0;
192 |
193 | while(!getAllCursor.isAfterLast())
194 | {
195 | packages[i] = getAllCursor.getString(1);
196 | i++;
197 | getAllCursor.moveToNext();
198 | }
199 |
200 | getAllCursor.close();
201 | closeDB();
202 |
203 | if (order.equals(Constants.ORDER_ORIGINAL))
204 | {
205 | Collections.reverse(Arrays.asList(packages));
206 | }
207 |
208 | return packages;
209 |
210 | }
211 |
212 | // ////////////////////////////////////////////////////
213 | // Method to get a count of rows in the filter table
214 | // ////////////////////////////////////////////////////
215 | public int getFiltersCount()
216 | {
217 | // connect
218 | connectDB();
219 |
220 | Cursor countCursor = db.rawQuery("SELECT count(*) FROM devdrawer_filter", null);
221 |
222 | // get number of rows
223 | countCursor.moveToFirst();
224 | int count = countCursor.getInt(0);
225 | countCursor.close();
226 |
227 | // close
228 | closeDB();
229 |
230 | return count;
231 |
232 | }
233 |
234 | ///////////////////////////////////////////////////////////////
235 | // Method to determine whether the new filter already exists
236 | ///////////////////////////////////////////////////////////////
237 | public boolean doesFilterExist(String s)
238 | {
239 | // connect
240 | connectDB();
241 |
242 | Cursor countCursor = db.rawQuery("SELECT count(*) FROM devdrawer_filter WHERE package = '" + s + "'", null);
243 |
244 | // get number of rows
245 | countCursor.moveToFirst();
246 | int count = countCursor.getInt(0);
247 | countCursor.close();
248 |
249 | // close
250 | closeDB();
251 |
252 | if (count == 0)
253 | return false;
254 | else
255 | return true;
256 | }
257 |
258 | // ////////////////////////////////////////////////////////////
259 | // Method to get a count of rows in the installed apps tables
260 | // ////////////////////////////////////////////////////////////
261 | public int getAppsCount()
262 | {
263 | // connect
264 | connectDB();
265 |
266 | Cursor countCursor = db.rawQuery("SELECT count(*) FROM devdrawer_app", null);
267 |
268 | // get number of rows
269 | countCursor.moveToFirst();
270 | int count = countCursor.getInt(0);
271 | countCursor.close();
272 |
273 | // close
274 | closeDB();
275 |
276 | return count;
277 |
278 | }
279 |
280 | /////////////////////////////////////////////////////////////////////////////////////////
281 | // Method to check whether the app being install exists in the installed package table
282 | /////////////////////////////////////////////////////////////////////////////////////////
283 | public boolean doesAppExistInDb(String s)
284 | {
285 | connectDB();
286 |
287 | Cursor cursor = db.query("devdrawer_app", null, "package = '" + s + "'", null, null, null, null, null);
288 | int count = cursor.getCount();
289 | cursor.close();
290 | closeDB();
291 |
292 | if (cursor.getCount() == 0)
293 | return false;
294 | else
295 | return true;
296 |
297 | }
298 |
299 | ////////////////////////////////////////////////////////////////
300 | // Method to delete a package from the installed package table
301 | ////////////////////////////////////////////////////////////////
302 | public void deleteAppFromDb(String s)
303 | {
304 | connectDB();
305 | db.execSQL("DELETE FROM devdrawer_app WHERE package ='" + s + "'");
306 | closeDB();
307 | }
308 |
309 | /////////////////////////////////////////////////////////////////////
310 | // Method to parse each row and return if the new package matches
311 | /////////////////////////////////////////////////////////////////////
312 | // TODO: Make this work for exact package name
313 | public int parseAndMatch(String p)
314 | {
315 |
316 | int match = NOT_FOUND;
317 |
318 | connectDB();
319 |
320 | Cursor getAllCursor = db.query("devdrawer_filter", null, null, null, null, null, null, null);
321 |
322 | getAllCursor.moveToFirst();
323 |
324 | while (!getAllCursor.isAfterLast())
325 | {
326 |
327 | String packageFilter = getAllCursor.getString(1).toLowerCase();
328 |
329 | if (packageFilter.contains("*"))
330 | {
331 | if (p.toLowerCase().startsWith(packageFilter.toLowerCase().substring(0, packageFilter.indexOf("*"))))
332 | match = Integer.valueOf(getAllCursor.getString(0));
333 |
334 | }
335 | else
336 | {
337 | if (p.toLowerCase().equals(packageFilter.toLowerCase()))
338 | match = Integer.valueOf(getAllCursor.getString(0));
339 |
340 | }
341 |
342 | getAllCursor.moveToNext();
343 |
344 | }
345 |
346 | getAllCursor.close();
347 | closeDB();
348 |
349 | return match;
350 |
351 | }
352 |
353 | ///////////////////////////////////
354 | // Method to amend a filter entry
355 | ///////////////////////////////////
356 | public void amendFilterEntryTo(String id, String newString)
357 | {
358 | connectDB();
359 | db.execSQL("UPDATE devdrawer_filter SET package='" + newString + "' WHERE id ='" + id + "'");
360 | closeDB();
361 | }
362 |
363 | ///////////////////////////////
364 | // Method to add all locales
365 | ///////////////////////////////
366 | public void addLocale(String localeDescriptor)
367 | {
368 | connectDB();
369 |
370 | db.execSQL("INSERT INTO devdrawer_locales (name) VALUES ('" + localeDescriptor + "');");
371 |
372 | closeDB();
373 | }
374 |
375 | public List getLocales()
376 | {
377 | connectDB();
378 |
379 | List list = new ArrayList();
380 |
381 | Cursor getAllCursor = db.query("devdrawer_locales", null, null, null, null, null, "name ASC", null);
382 |
383 | if (getAllCursor.getCount() != 0)
384 | {
385 | getAllCursor.moveToFirst();
386 |
387 | while(!getAllCursor.isAfterLast())
388 | {
389 | list.add(getAllCursor.getString(0));
390 | getAllCursor.moveToNext();
391 | }
392 | }
393 |
394 | return list;
395 | }
396 |
397 | public void deleteLocale(String localeDescriptor)
398 | {
399 | connectDB();
400 |
401 | db.execSQL("DELETE FROM devdrawer_locales WHERE name = '" + localeDescriptor + "';");
402 |
403 | closeDB();
404 | }
405 |
406 | }
407 |
--------------------------------------------------------------------------------
/src/com/owentech/DevDrawer/utils/PackageCollection.java:
--------------------------------------------------------------------------------
1 | package com.owentech.DevDrawer.utils;
2 |
3 | /**
4 | * Created with IntelliJ IDEA.
5 | * User: owent
6 | * Date: 31/01/2013
7 | * Time: 19:31
8 | * To change this template use File | Settings | File Templates.
9 | */
10 | public class PackageCollection
11 | {
12 | // Simple class to hold id and packagename together
13 | public String mId;
14 | public String mPackageName;
15 |
16 | public PackageCollection(String id, String packageName)
17 | {
18 |
19 | mId = id;
20 | mPackageName = packageName;
21 |
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/com/owentech/DevDrawer/utils/RootFeatures.java:
--------------------------------------------------------------------------------
1 | package com.owentech.DevDrawer.utils;
2 |
3 | import android.os.AsyncTask;
4 | import eu.chainfire.libsuperuser.Shell;
5 |
6 | import java.util.ArrayList;
7 | import java.util.List;
8 |
9 | /**
10 | * Created with IntelliJ IDEA.
11 | * User: ramdroid
12 | * Date: 5/1/13
13 | * Time: 10:54 AM
14 | * To change this template use File | Settings | File Templates.
15 | */
16 | public class RootFeatures {
17 |
18 | public static void checkAccess(Listener listener) {
19 | new Worker(listener).execute(new Command(CHECK_ACCESS));
20 | }
21 |
22 | public static void uninstall(String packageName, Listener listener) {
23 | new Worker(listener).execute(new Command(UNINSTALL, packageName));
24 | }
25 |
26 | public static void clearCache(String packageName, Listener listener) {
27 | new Worker(listener).execute(new Command(CLEAR_CACHE, packageName));
28 | }
29 |
30 | public static void changeSystemLocale(String path, String language, String country, Listener listener) {
31 | List params = new ArrayList();
32 | params.add(path);
33 | params.add(language);
34 | params.add(country);
35 | new Worker(listener).execute(new Command(SYSTEM_LOCALE, params));
36 | }
37 |
38 | public static interface Listener {
39 | void onFinished(boolean result);
40 | }
41 |
42 | private static final int CHECK_ACCESS = 42;
43 | private static final int UNINSTALL = 43;
44 | private static final int CLEAR_CACHE = 44;
45 | private static final int SYSTEM_LOCALE = 45;
46 |
47 | private static class Command {
48 | int id;
49 | List params = new ArrayList();
50 |
51 | Command(int id) {
52 | this.id = id;
53 | }
54 |
55 | Command(int id, String param) {
56 | this.id = id;
57 | this.params.add(param);
58 | }
59 |
60 | Command(int id, List params) {
61 | this.id = id;
62 | this.params.addAll(params);
63 | }
64 | }
65 |
66 | private static class Worker extends AsyncTask {
67 |
68 | private Listener listener;
69 |
70 | Worker(Listener listener) {
71 | this.listener = listener;
72 | }
73 |
74 | @Override
75 | protected Boolean doInBackground(Command... cmds) {
76 | boolean result = false;
77 | if (cmds[0].id == CHECK_ACCESS) {
78 | result = Shell.SU.available();
79 | }
80 | else if (cmds[0].id == UNINSTALL) {
81 | List res = Shell.SU.run(new String[] { "pm uninstall " + cmds[0].params.get(0), "echo \"OK\"" });
82 | result = (res != null && res.size() > 0);
83 | }
84 | else if (cmds[0].id == CLEAR_CACHE) {
85 | List res = Shell.SU.run(new String[] { "pm clear " + cmds[0].params.get(0), "echo \"OK\"" });
86 | result = (res != null && res.size() > 0);
87 | }
88 | else if (cmds[0].id == SYSTEM_LOCALE) {
89 | String path = cmds[0].params.get(0);
90 | String language = cmds[0].params.get(1);
91 | String country = cmds[0].params.get(2);
92 | List res = Shell.run("su",
93 | new String[]{"app_process /system/bin com.owentech.DevDrawer.utils.RootLocaleSwitcher " + language + " " + country},
94 | new String[]{"CLASSPATH=" + path},
95 | true);
96 | result = (res != null && res.size() > 0);
97 | }
98 | return result;
99 | }
100 |
101 | protected void onPostExecute(Boolean result) {
102 | listener.onFinished(result);
103 | }
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/src/com/owentech/DevDrawer/utils/RootLocaleSwitcher.java:
--------------------------------------------------------------------------------
1 | package com.owentech.DevDrawer.utils;
2 |
3 | import android.app.ActivityManagerNative;
4 | import android.app.IActivityManager;
5 | import android.content.res.Configuration;
6 | import android.os.RemoteException;
7 |
8 | import java.util.Locale;
9 |
10 | /**
11 | * Created with IntelliJ IDEA.
12 | * User: ramdroid
13 | * Date: 5/11/13
14 | * Time: 10:39 PM
15 | * To change this template use File | Settings | File Templates.
16 | */
17 | public final class RootLocaleSwitcher {
18 |
19 | public static void main(String[] args) {
20 | if (args.length == 2) {
21 | switchLocales(args[0], args[1]);
22 | }
23 | else {
24 | System.err.println("invalid parameters");
25 | }
26 | }
27 |
28 | private static void switchLocales(String language, String country) {
29 | Locale locale;
30 |
31 | if (country != null)
32 | {
33 | locale = new Locale(language, country);
34 | }
35 | else
36 | {
37 | locale = new Locale(language);
38 | }
39 |
40 | IActivityManager am = ActivityManagerNative.getDefault();
41 |
42 | try {
43 | Configuration config = am.getConfiguration();
44 | config.locale = locale;
45 | am.updateConfiguration(config);
46 |
47 | } catch (RemoteException e) {
48 | System.err.println(e.toString());
49 | }
50 |
51 | System.out.println("Switched locale to " + language + " " + country);
52 | }
53 | }
54 |
--------------------------------------------------------------------------------