├── .gitignore
├── Licenses.md
├── PrivacyPolicy.md
├── README.md
├── app
├── .gitignore
├── LGQSlideAPIs.jar
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── yoavst
│ │ └── quickapps
│ │ ├── AdminListener.kt
│ │ ├── CoverReceiver.kt
│ │ ├── UninstallReceiver.kt
│ │ ├── ball
│ │ └── CMagic8BallActivity.kt
│ │ ├── barcode
│ │ ├── CBarcodeActivity.kt
│ │ ├── Contents.kt
│ │ ├── LocaleManager.kt
│ │ ├── NetworkType.kt
│ │ ├── ResultBarcodeActivity.kt
│ │ ├── Util.java
│ │ ├── WifiConfigManager.kt
│ │ └── tools
│ │ │ ├── QRCodeReaderView.java
│ │ │ ├── camera
│ │ │ └── open
│ │ │ │ ├── AutoFocusManager.java
│ │ │ │ ├── CameraConfigurationManager.java
│ │ │ │ ├── CameraManager.java
│ │ │ │ ├── DefaultOpenCameraInterface.java
│ │ │ │ ├── GingerbreadOpenCameraInterface.java
│ │ │ │ ├── OpenCameraInterface.java
│ │ │ │ └── OpenCameraManager.java
│ │ │ └── common
│ │ │ ├── PlatformSupportManager.java
│ │ │ └── executor
│ │ │ ├── AsyncTaskExecInterface.java
│ │ │ ├── AsyncTaskExecManager.java
│ │ │ ├── DefaultAsyncTaskExecInterface.java
│ │ │ └── HoneycombAsyncTaskExecInterface.java
│ │ ├── calculator
│ │ ├── CCalculatorActivity.kt
│ │ └── CalculatorFragment.kt
│ │ ├── calendar
│ │ ├── CCalendarActivity.kt
│ │ ├── CalendarFragment.kt
│ │ ├── CalendarUtil.java
│ │ ├── Event.java
│ │ ├── EventRetiever.kt
│ │ ├── EventsAdapter.kt
│ │ └── package.kt
│ │ ├── clock
│ │ ├── CClockActivity.kt
│ │ ├── ClockAdapter.kt
│ │ ├── PhoneActivity.kt
│ │ ├── StopwatchFragment.kt
│ │ ├── StopwatchManager.kt
│ │ ├── Timer.kt
│ │ ├── TimerFragment.kt
│ │ └── TimerIntentService.kt
│ │ ├── compass
│ │ ├── CCompassActivity.kt
│ │ ├── Compass.kt
│ │ └── PhoneActivity.kt
│ │ ├── desktop
│ │ ├── AboutFragment.kt
│ │ ├── BaseModuleView.kt
│ │ ├── DataActivity.kt
│ │ ├── HowToFragment.kt
│ │ ├── LaunchAdminActivity.kt
│ │ ├── MainActivity.kt
│ │ ├── ModulesFragment.kt
│ │ ├── SourceFragment.kt
│ │ └── modules
│ │ │ ├── CalculatorModuleView.kt
│ │ │ ├── CalendarModuleView.kt
│ │ │ ├── ClockModuleView.kt
│ │ │ ├── DialerModuleView.kt
│ │ │ ├── GeneralSettingsView.kt
│ │ │ ├── LauncherModuleView.kt
│ │ │ ├── MusicModuleView.kt
│ │ │ ├── NewsModuleView.kt
│ │ │ ├── NotificationsModuleView.kt
│ │ │ ├── TogglesModuleView.kt
│ │ │ ├── TorchModuleView.kt
│ │ │ └── WatchfaceModuleView.kt
│ │ ├── dialer
│ │ ├── CDialerActivity.kt
│ │ ├── ContactsAdapter.kt
│ │ ├── ContactsFragment.kt
│ │ ├── DialerAdapter.kt
│ │ ├── DialerFragment.kt
│ │ └── PhoneNumberWrapper.kt
│ │ ├── dice
│ │ └── CDiceActivity.kt
│ │ ├── launcher
│ │ ├── CLauncherActivity.kt
│ │ ├── ItemsListAdapter.kt
│ │ ├── LauncherDeSerializer.kt
│ │ └── ListItem.kt
│ │ ├── music
│ │ ├── AbstractRemoteControlService.kt
│ │ ├── CMusicActivity.kt
│ │ ├── PlayPauseView.java
│ │ ├── RemoteControlService.kt
│ │ └── RemoteControlServiceLollipop.kt
│ │ ├── news
│ │ ├── CNewsActivity.kt
│ │ ├── DownloadManager.kt
│ │ ├── FeedlyApi.kt
│ │ ├── LoginActivity.kt
│ │ ├── NewsAdapter.kt
│ │ ├── NewsFragment.kt
│ │ ├── URLEncodedUtils.java
│ │ └── types
│ │ │ ├── AuthResponse.java
│ │ │ └── Entry.java
│ │ ├── notifications
│ │ ├── CNotificationActivity.kt
│ │ ├── NotificationAdapter.kt
│ │ ├── NotificationService.kt
│ │ ├── NotificationsFragment.kt
│ │ └── NotificationsManager.kt
│ │ ├── recorder
│ │ ├── AudioRecorder.java
│ │ ├── CRecorderActivity.kt
│ │ ├── Mp4ParserWrapper.java
│ │ └── RecordButton.java
│ │ ├── simon
│ │ ├── CSimonActivity.kt
│ │ ├── OppositeSemiCircleView.kt
│ │ ├── SemiCircleDrawable.kt
│ │ ├── SemiCircleView.kt
│ │ └── SimonGame.kt
│ │ ├── toggles
│ │ ├── CTogglesActivity.kt
│ │ ├── Connectivity.kt
│ │ ├── ToggleFragment.kt
│ │ ├── ToggleItem.kt
│ │ ├── TogglesAdapter.kt
│ │ ├── TogglesListAdapter.kt
│ │ └── toggles
│ │ │ ├── BatteryFragment.kt
│ │ │ ├── BluetoothFragment.kt
│ │ │ ├── BrightnessFragment.kt
│ │ │ ├── HotspotFragment.kt
│ │ │ ├── SoundFragment.kt
│ │ │ └── WifiFragment.kt
│ │ ├── tools
│ │ ├── AutoResizeTextView.java
│ │ ├── BaseAnimationListener.java
│ │ ├── DividerItemDecoration.java
│ │ ├── DragSortRecycler.java
│ │ ├── EmptyReceiver.kt
│ │ ├── ForegroundImageView.java
│ │ ├── MyLinearLayoutManager.java
│ │ ├── Prefs.kt
│ │ ├── QCircleActivity.kt
│ │ ├── package.kt
│ │ └── viewanimations
│ │ │ ├── BaseViewAnimator.kt
│ │ │ ├── ShakeAnimator.kt
│ │ │ └── YoYo.java
│ │ ├── torch
│ │ ├── CTorchActivity.kt
│ │ ├── CameraManager.kt
│ │ ├── KitkatCameraManagerImpl.java
│ │ ├── NotificationReceiver.kt
│ │ ├── PhoneActivity.kt
│ │ ├── PhoneActivityNotFloating.kt
│ │ ├── Torch.kt
│ │ ├── TorchDelegate.kt
│ │ ├── TorchReceiver.kt
│ │ └── WidgetProvider.kt
│ │ └── watchfaces
│ │ └── DigitalWatchfaceProvider.kt
│ └── res
│ ├── anim
│ ├── circle_expand_toggle.xml
│ ├── circle_expand_torch.xml
│ ├── circle_path_toggle.xml
│ └── circle_path_torch.xml
│ ├── drawable-640dpi
│ ├── calculator_advanced_btn_functions_cos.png
│ ├── calculator_advanced_btn_functions_cos1.png
│ ├── calculator_advanced_btn_functions_log.png
│ ├── calculator_advanced_btn_functions_sin.png
│ ├── calculator_advanced_btn_functions_sin1.png
│ ├── calculator_advanced_btn_functions_tan.png
│ ├── calculator_advanced_btn_functions_tan1.png
│ ├── calculator_advanced_btn_functions_xy.png
│ ├── calculator_advanced_btn_operators_ans.png
│ ├── calculator_advanced_btn_operators_pi.png
│ ├── calculator_basic_btn_delete.png
│ ├── calculator_basic_btn_delete_ac.png
│ ├── calculator_basic_btn_equal.png
│ ├── calculator_basic_btn_number_0.png
│ ├── calculator_basic_btn_number_1.png
│ ├── calculator_basic_btn_number_2.png
│ ├── calculator_basic_btn_number_3.png
│ ├── calculator_basic_btn_number_4.png
│ ├── calculator_basic_btn_number_5.png
│ ├── calculator_basic_btn_number_6.png
│ ├── calculator_basic_btn_number_7.png
│ ├── calculator_basic_btn_number_8.png
│ ├── calculator_basic_btn_number_9.png
│ ├── calculator_basic_btn_number_dot.png
│ ├── calculator_basic_btn_operators_bracket.png
│ ├── calculator_basic_btn_operators_division.png
│ ├── calculator_basic_btn_operators_multiply.png
│ ├── calculator_basic_btn_operators_plus.png
│ ├── calculator_basic_btn_operators_root.png
│ ├── calculator_basic_btn_operators_subtraction.png
│ └── calculator_basic_btn_operators_x.png
│ ├── drawable-nodpi
│ ├── circle_background.png
│ ├── d1.png
│ ├── d2.png
│ ├── d3.png
│ ├── d4.png
│ ├── d5.png
│ ├── d6.png
│ ├── game_over.png
│ ├── old_qcircle_icon_calculator.png
│ ├── old_qcircle_icon_calendar.png
│ ├── old_qcircle_icon_clock.png
│ ├── old_qcircle_icon_compass.png
│ ├── old_qcircle_icon_music.png
│ ├── old_qcircle_icon_recorder.png
│ ├── old_qcircle_icon_toggles.png
│ ├── old_qcircle_icon_torch.png
│ ├── preview.png
│ ├── qcircle_icon_ball.png
│ ├── qcircle_icon_barcode.png
│ ├── qcircle_icon_calculator.png
│ ├── qcircle_icon_calendar.png
│ ├── qcircle_icon_clock.png
│ ├── qcircle_icon_compass.png
│ ├── qcircle_icon_dialer.png
│ ├── qcircle_icon_dice.png
│ ├── qcircle_icon_launcher.png
│ ├── qcircle_icon_music.png
│ ├── qcircle_icon_news.png
│ ├── qcircle_icon_notifications.png
│ ├── qcircle_icon_recorder.png
│ ├── qcircle_icon_simon.png
│ ├── qcircle_icon_toggles.png
│ └── qcircle_icon_torch.png
│ ├── drawable-v21
│ ├── dialer_btn_back.xml
│ ├── dialer_btn_call.xml
│ ├── dialer_btn_delete.xml
│ ├── dialer_btn_digit.xml
│ ├── stopwatch_btn_pause.xml
│ ├── stopwatch_btn_start.xml
│ └── stopwatch_btn_stop.xml
│ ├── drawable-xhdpi
│ ├── ic_drawer.png
│ └── ic_noti_torch.png
│ ├── drawable-xxhdpi
│ ├── ic_drawer.png
│ └── ic_noti_torch.png
│ ├── drawable-xxxhdpi
│ ├── compass_back.png
│ └── compass_needle.png
│ ├── drawable
│ ├── animated_bluetooth.xml
│ ├── animated_power.xml
│ ├── calculator_btn_ac.xml
│ ├── calculator_btn_ac_inset.xml
│ ├── calculator_btn_delete.xml
│ ├── calculator_btn_delete_inset.xml
│ ├── calculator_btn_equal.xml
│ ├── calculator_btn_equal_inset.xml
│ ├── calculator_btn_function.xml
│ ├── calculator_btn_function_inset.xml
│ ├── calculator_btn_regular.xml
│ ├── calculator_btn_regular_inset.xml
│ ├── dialer_btn_back.xml
│ ├── dialer_btn_call.xml
│ ├── dialer_btn_delete.xml
│ ├── dialer_btn_digit.xml
│ ├── drag.png
│ ├── ic_add.xml
│ ├── ic_back.xml
│ ├── ic_bluetooth.xml
│ ├── ic_brightness.xml
│ ├── ic_brightness_auto.xml
│ ├── ic_brightness_high.xml
│ ├── ic_brightness_low.xml
│ ├── ic_brightness_medium.xml
│ ├── ic_call.xml
│ ├── ic_delete.xml
│ ├── ic_done.xml
│ ├── ic_pause.xml
│ ├── ic_play.xml
│ ├── ic_power.xml
│ ├── ic_refresh.xml
│ ├── ic_remove.xml
│ ├── ic_skip_next.xml
│ ├── ic_skip_prev.xml
│ ├── ic_sound.xml
│ ├── ic_vibrate.xml
│ ├── ic_volume.xml
│ ├── ic_wifi.xml
│ ├── ic_wifi_tethering.xml
│ ├── ic_wifi_tethering_off.xml
│ ├── icon_music.xml
│ ├── icon_torch.xml
│ ├── notification_background.xml
│ ├── notification_delete.xml
│ ├── quickcircle_settings.png
│ ├── shape_oval.xml
│ ├── stopwatch_btn_pause.xml
│ ├── stopwatch_btn_pause_normal.xml
│ ├── stopwatch_btn_start.xml
│ ├── stopwatch_btn_start_normal.xml
│ ├── stopwatch_btn_stop.xml
│ ├── stopwatch_btn_stop_normal.xml
│ └── toggle_background.xml
│ ├── layout-v21
│ └── torch_activity.xml
│ ├── layout
│ ├── barcode_dialog.xml
│ ├── calculator_activity.xml
│ ├── calculator_fragment.xml
│ ├── calendar_activity.xml
│ ├── calendar_fragment.xml
│ ├── clock_activity.xml
│ ├── clock_qslide_activity.xml
│ ├── clock_stopwatch_fragment.xml
│ ├── clock_timer_fragment.xml
│ ├── compass_activity.xml
│ ├── compass_qslide_activity.xml
│ ├── deskop_launcher_item.xml
│ ├── desktop_activity_data.xml
│ ├── desktop_activity_header.xml
│ ├── desktop_activity_main.xml
│ ├── desktop_fragment_about.xml
│ ├── desktop_fragment_howto.xml
│ ├── desktop_fragment_modules.xml
│ ├── desktop_fragment_source.xml
│ ├── desktop_toggle_item.xml
│ ├── desktop_view_dial.xml
│ ├── desktop_view_line.xml
│ ├── desktop_view_line_color.xml
│ ├── desktop_view_module.xml
│ ├── dialer_activity.xml
│ ├── dialer_fragment.xml
│ ├── dice_activity.xml
│ ├── launcher_horizontal_fragment.xml
│ ├── launcher_vertical_fragment.xml
│ ├── music_activity.xml
│ ├── music_old_buttons.xml
│ ├── music_old_header.xml
│ ├── news_activity.xml
│ ├── news_fragment.xml
│ ├── notification_activity.xml
│ ├── notification_fragment.xml
│ ├── qcircle_empty.xml
│ ├── recorder_activity.xml
│ ├── simon_activity.xml
│ ├── toggles_toggle_fragment.xml
│ ├── torch_activity.xml
│ ├── torch_widget.xml
│ └── watchface_layout.xml
│ ├── menu
│ ├── drawer.xml
│ └── menu_activity.xml
│ ├── mipmap-xhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxxhdpi
│ └── ic_launcher.png
│ ├── raw
│ ├── a.m4a
│ ├── b.m4a
│ ├── c.m4a
│ └── d.m4a
│ ├── values-ar
│ └── strings.xml
│ ├── values-ca
│ └── strings.xml
│ ├── values-de
│ └── strings.xml
│ ├── values-es
│ └── strings.xml
│ ├── values-fi
│ └── strings.xml
│ ├── values-fr
│ └── strings.xml
│ ├── values-he
│ └── strings.xml
│ ├── values-hu
│ └── strings.xml
│ ├── values-it
│ └── strings.xml
│ ├── values-iw
│ └── strings.xml
│ ├── values-ko
│ └── strings.xml
│ ├── values-nl
│ └── strings.xml
│ ├── values-pl
│ └── strings.xml
│ ├── values-ru
│ └── strings.xml
│ ├── values-tr
│ └── strings.xml
│ ├── values-v21
│ └── bools.xml
│ ├── values-xxxhdpi
│ └── dimens.xml
│ ├── values
│ ├── attrs.xml
│ ├── bools.xml
│ ├── calculator.xml
│ ├── colors.xml
│ ├── donottranslate.xml
│ ├── integers.xml
│ ├── md_colors.xml
│ ├── strings.xml
│ └── styles.xml
│ └── xml
│ ├── device_admin_permissions.xml
│ ├── digital_clock_watchface.xml
│ └── torch_widget_provider.xml
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── images
├── barcode.png
├── calculator.png
├── calendar.png
├── clock.png
├── compass.png
├── dice.png
├── magic8ball.png
├── music.png
├── news.png
├── notifications.png
├── phone.png
├── recorder.png
├── simon.png
├── toggles.png
└── torch.png
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by .ignore support plugin (hsz.mobi)
2 | ### Android template
3 | # Built application files
4 | *.apk
5 | *.ap_
6 |
7 | # Files for the Dalvik VM
8 | *.dex
9 |
10 | # Java class files
11 | *.class
12 |
13 | # Generated files
14 | bin/
15 | gen/
16 |
17 | # Gradle files
18 | .gradle/
19 | build/
20 | /*/build/
21 |
22 | # Local configuration file (sdk path, etc)
23 | local.properties
24 |
25 | # Proguard folder generated by Eclipse
26 | proguard/
27 |
28 | # Log Files
29 | *.log
30 |
31 |
32 | ### JetBrains template
33 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion
34 |
35 | *.iml
36 |
37 | ## Directory-based project format:
38 | .idea/
39 | # if you remove the above rule, at least ignore the following:
40 |
41 | # User-specific stuff:
42 | # .idea/workspace.xml
43 | # .idea/tasks.xml
44 | # .idea/dictionaries
45 |
46 | # Sensitive or high-churn files:
47 | # .idea/dataSources.ids
48 | # .idea/dataSources.xml
49 | # .idea/sqlDataSources.xml
50 | # .idea/dynamic.xml
51 | # .idea/uiDesigner.xml
52 |
53 | # Gradle:
54 | # .idea/gradle.xml
55 | # .idea/libraries
56 |
57 | # Mongo Explorer plugin:
58 | # .idea/mongoSettings.xml
59 |
60 | ## File-based project format:
61 | *.ipr
62 | *.iws
63 |
64 | ## Plugin-specific files:
65 |
66 | # IntelliJ
67 | /out/
68 |
69 | # mpeltonen/sbt-idea plugin
70 | .idea_modules/
71 |
72 | # JIRA plugin
73 | atlassian-ide-plugin.xml
74 |
75 | # Crashlytics plugin (for Android Studio and IntelliJ)
76 | com_crashlytics_export_strings.xml
77 | crashlytics.properties
78 | crashlytics-build.properties
79 |
80 | #Kotlin annotations directory
81 | /annotations/
82 |
83 |
84 |
--------------------------------------------------------------------------------
/PrivacyPolicy.md:
--------------------------------------------------------------------------------
1 | Privacy Policy
2 | =============
3 | **TL;DR**: Your private information is safe.
4 | The application doesn't send any data to our servers, yet it uses Google Ads which may send some data to Google's servers.
5 |
6 |
7 | ## Who am I?
8 | Yoav Sternberg, 18 years old developer from Israel. For more information about me and contact details, enter [my website](http://yoavst.com).
9 |
10 | 
11 |
12 | ## What precise categories of personal data the app wants to collect and process
13 | Nothing. There is no analytics or any data sent to our servers.
14 |
15 | ## Whether data will be disclosed to third parties
16 | The application uses Google ads for Android. Check their privacy policy [here](https://www.google.com/policies/technologies/ads/).
17 |
18 | ## What rights users have, in terms of withdrawal of consent and deletion of data
19 | No data is being collected by us.
20 |
21 | ## Permission usage
22 | The app uses many permissions in order to provide its functionality. Including:
23 | * DEVICE_ADMIN: optional; provides double-tap to sleep functionality.
24 | * CAMERA: For Quick torch (flashlight) functionality.
25 | * RECORD_AUDIO: For Quick recorder functionality.
26 | * READ_CONTACTS: For quick dialer functionality.
27 | * READ_PHONE_STATE: Used by google ads.
28 |
29 | Those permissions can be disabled if you don't use the specific component (e.g. disable RECORD_AUDIO if not using Quick Recorder)
30 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Quick Circle Apps
2 |
3 | [](https://gitter.im/yoavst/quickapps?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4 |
5 | **Quick Circle Apps** is an Android application made by Yoav Sternberg.
6 | The application provide modules for the Quick Circle Case.
7 |
8 | [](https://play.google.com/store/apps/details?id=com.yoavst.quickapps)
9 |
10 | ## How it works?
11 | The app uses LG Quick Circle SDK and QSlide SDK.
12 | The app was built using Kotlin, A Statically typed programming language targeting the JVM and JavaScript, which was developed by JetBrains.
13 |
14 | * Torch - Enable/Disable camera flash.
15 | * Music -Register `NotificationListenerService` that implements `RemoteController.OnClientUpdateListener`.
16 | * Notifications - Register another `NotificationListenerService`.
17 | * Calendar - Reading events data from `CalendarContract.Events`.
18 | * Toggles - Each toggles use its permissions to change the state.
19 | * Stopwatch - Uses `TimerTask` that run every 10 milliseconds to update the clock.
20 | * Calculator - Evaluate the math string using EvalEx library.
21 | * News - Use Feedly Cloud Api to receive the newest 20 articles from the user feed.
22 | * Compass - Use Compass sensor.
23 | * Dialer - call `ACTION_CALL` intent. The on-call screen is LG's one.
24 | * Magic 8 ball - Magic...
25 | * Recorder - use `MediaRecorder` to recorded audio.
26 | * Barcode Scanner - using zxing library.
27 | * Dice - a poor paid man that roll dices for us.
28 |
29 | License
30 | -------
31 |
32 | Copyright 2014 Yoav Sternberg
33 |
34 | Quick Circle Apps is free software: you can redistribute it and/or modify
35 | it under the terms of the GNU General Public License as published by
36 | the Free Software Foundation, either version 3 of the License, or
37 | (at your option) any later version.
38 |
39 | Quick Circle Apps is distributed in the hope that it will be useful,
40 | but WITHOUT ANY WARRANTY; without even the implied warranty of
41 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42 | GNU General Public License for more details.
43 |
44 | You should have received a copy of the GNU General Public License
45 | along with Quick Circle Apps. If not, see .
46 |
47 | ---
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/LGQSlideAPIs.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/LGQSlideAPIs.jar
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /home/yoavst/tools/android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/AdminListener.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps
2 |
3 | import android.app.admin.DeviceAdminReceiver
4 |
5 | /**
6 | * Admin Listener. Quick Circle Apps using admin permissions for locking the screen on double tap.
7 | */
8 | public class AdminListener: DeviceAdminReceiver()
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/CoverReceiver.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps
2 |
3 | import android.content.BroadcastReceiver
4 | import android.content.Context
5 | import android.content.Intent
6 | import android.provider.Settings
7 | import kotlin.platform.platformStatic
8 |
9 | public class CoverReceiver : BroadcastReceiver() {
10 |
11 | override fun onReceive(context: Context, intent: Intent) {
12 | val action = intent.getAction() ?: return
13 | val quickCaseType = Settings.Global.getInt(context.getContentResolver(), "cover_type", 0)
14 | val quickCircleEnabled = Settings.Global.getInt(context.getContentResolver(), "quick_view_enable", 0)
15 | // Receives a LG QCirle intent for the cover event
16 | if (ACTION_ACCESSORY_COVER_EVENT == action && quickCaseType == QUICKCOVERSETTINGS_QUICKCIRCLE && quickCircleEnabled == QUICKCOVERSETTINGS_USEQUICKCIRCLE) {
17 | // Gets the current state of the cover
18 | val quickCoverState = intent.getIntExtra(EXTRA_ACCESSORY_COVER_STATE, EXTRA_ACCESSORY_COVER_OPENED)
19 | if (quickCoverState == EXTRA_ACCESSORY_COVER_CLOSED) {
20 | // closed
21 | isCoverInUse = true
22 | } else if (quickCoverState == EXTRA_ACCESSORY_COVER_OPENED) {
23 | // opened
24 | isCoverInUse = false
25 | }
26 | }
27 | }
28 |
29 | companion object {
30 | /**
31 | * True if is in cover mode, false if regular.
32 | */
33 | public platformStatic var isCoverInUse: Boolean = false
34 | protected val EXTRA_ACCESSORY_COVER_OPENED: Int = 0
35 | protected val EXTRA_ACCESSORY_COVER_CLOSED: Int = 1
36 | protected val EXTRA_ACCESSORY_COVER_STATE: String = "com.lge.intent.extra.ACCESSORY_COVER_STATE"
37 | protected val ACTION_ACCESSORY_COVER_EVENT: String = "com.lge.android.intent.action.ACCESSORY_COVER_EVENT"
38 | protected val QUICKCOVERSETTINGS_QUICKCIRCLE: Int = 3
39 | protected val QUICKCOVERSETTINGS_USEQUICKCIRCLE: Int = 1
40 |
41 | }
42 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/UninstallReceiver.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps
2 |
3 | import android.content.BroadcastReceiver
4 | import android.content.Context
5 | import android.content.Intent
6 | import android.support.v4.util.Pair
7 | import com.yoavst.kotlin.e
8 | import com.yoavst.quickapps.launcher.CLauncherActivity
9 | import com.yoavst.quickapps.launcher.ListItem
10 | import com.yoavst.quickapps.tools.launcherItems
11 | import java.util.ArrayList
12 |
13 | public class UninstallReceiver : BroadcastReceiver() {
14 | override fun onReceive(context: Context, intent: Intent) {
15 | val name = intent.getData()?.getSchemeSpecificPart()
16 | if (name != null && name.isNotEmpty()) {
17 | val apps = context.launcherItems
18 | if (apps != "{}") {
19 | var data = CLauncherActivity.gson.fromJson>>(apps, CLauncherActivity.ListType)
20 | if (data == null || data.first == null || !data.first!!) {
21 |
22 | } else {
23 | for (i in (data.second.size() - 1) downTo 0) {
24 | if (name in data.second[i].activity) {
25 | data.second.remove(i)
26 | context.launcherItems = CLauncherActivity.gson.toJson(data)
27 | break
28 | }
29 | }
30 | }
31 | }
32 | }
33 | }
34 |
35 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/barcode/NetworkType.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 ZXing authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.yoavst.quickapps.barcode
18 |
19 | enum class NetworkType {
20 | WEP,
21 | WPA,
22 | NO_PASSWORD;
23 | companion object {
24 | fun forIntentValue(networkTypeString: String?): NetworkType {
25 | if (networkTypeString == null) {
26 | return NO_PASSWORD
27 | }
28 | if ("WPA" == networkTypeString ) {
29 | return WPA
30 | }
31 | if ("WEP" == networkTypeString ) {
32 | return WEP
33 | }
34 | if ("nopass" == networkTypeString ) {
35 | return NO_PASSWORD
36 | }
37 | throw IllegalArgumentException(networkTypeString)
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/barcode/tools/camera/open/DefaultOpenCameraInterface.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 ZXing authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.yoavst.quickapps.barcode.tools.camera.open;
18 |
19 | import android.hardware.Camera;
20 |
21 | /**
22 | * Default implementation for Android before API 9 / Gingerbread.
23 | */
24 | final class DefaultOpenCameraInterface implements OpenCameraInterface {
25 |
26 | /**
27 | * Calls {@link Camera#open()}.
28 | */
29 | @Override
30 | public Camera open() {
31 | return Camera.open();
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/barcode/tools/camera/open/GingerbreadOpenCameraInterface.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 ZXing authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.yoavst.quickapps.barcode.tools.camera.open;
18 |
19 | import android.annotation.TargetApi;
20 | import android.hardware.Camera;
21 | import android.util.Log;
22 |
23 | /**
24 | * Implementation for Android API 9 (Gingerbread) and later. This opens up the possibility of accessing
25 | * front cameras, and rotated cameras.
26 | */
27 | @TargetApi(9)
28 | public final class GingerbreadOpenCameraInterface implements OpenCameraInterface {
29 |
30 | private static final String TAG = "GingerbreadOpenCamera";
31 |
32 | /**
33 | * Opens a rear-facing camera with {@link Camera#open(int)}, if one exists, or opens camera 0.
34 | */
35 | @Override
36 | public Camera open() {
37 |
38 | int numCameras = Camera.getNumberOfCameras();
39 | if (numCameras == 0) {
40 | Log.w(TAG, "No cameras!");
41 | return null;
42 | }
43 |
44 | int index = 0;
45 | while (index < numCameras) {
46 | Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
47 | Camera.getCameraInfo(index, cameraInfo);
48 | if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_BACK) {
49 | break;
50 | }
51 | index++;
52 | }
53 |
54 | Camera camera;
55 | if (index < numCameras) {
56 | Log.i(TAG, "Opening camera #" + index);
57 | camera = Camera.open(index);
58 | } else {
59 | Log.i(TAG, "No camera facing back; returning camera #0");
60 | camera = Camera.open(0);
61 | }
62 |
63 | return camera;
64 | }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/barcode/tools/camera/open/OpenCameraInterface.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 ZXing authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.yoavst.quickapps.barcode.tools.camera.open;
18 |
19 | import android.hardware.Camera;
20 |
21 | /**
22 | * Provides an abstracted means to open a {@link Camera}. The API changes over Android API versions and
23 | * this allows the app to use newer API methods while retaining backwards-compatible behavior.
24 | */
25 | public interface OpenCameraInterface {
26 |
27 | Camera open();
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/barcode/tools/camera/open/OpenCameraManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 ZXing authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.yoavst.quickapps.barcode.tools.camera.open;
18 |
19 |
20 | import com.yoavst.quickapps.barcode.tools.common.PlatformSupportManager;
21 |
22 | /**
23 | * Selects an appropriate implementation of {@link OpenCameraInterface} based on the device's
24 | * API level.
25 | */
26 | public final class OpenCameraManager extends PlatformSupportManager {
27 |
28 | public OpenCameraManager() {
29 | super(OpenCameraInterface.class, new DefaultOpenCameraInterface());
30 | addImplementationClass(9, "com.yoavst.quickapps.barcode.tools.camera.open.GingerbreadOpenCameraInterface");
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/barcode/tools/common/executor/AsyncTaskExecInterface.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 ZXing authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.yoavst.quickapps.barcode.tools.common.executor;
18 |
19 | import android.os.AsyncTask;
20 |
21 | public interface AsyncTaskExecInterface {
22 |
23 | void execute(AsyncTask task, T... args);
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/barcode/tools/common/executor/AsyncTaskExecManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 ZXing authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.yoavst.quickapps.barcode.tools.common.executor;
18 |
19 |
20 | import com.yoavst.quickapps.barcode.tools.common.PlatformSupportManager;
21 |
22 | public final class AsyncTaskExecManager extends PlatformSupportManager {
23 |
24 | public AsyncTaskExecManager() {
25 | super(AsyncTaskExecInterface.class, new DefaultAsyncTaskExecInterface());
26 | addImplementationClass(11, "com.yoavst.quickapps.barcode.tools.common.executor.HoneycombAsyncTaskExecInterface");
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/barcode/tools/common/executor/DefaultAsyncTaskExecInterface.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 ZXing authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.yoavst.quickapps.barcode.tools.common.executor;
18 |
19 | import android.os.AsyncTask;
20 |
21 | /**
22 | * Before Honeycomb, {@link AsyncTask} uses parallel execution by default, which is desired. Good thing
23 | * too since there is no API to request otherwise.
24 | */
25 | public final class DefaultAsyncTaskExecInterface implements AsyncTaskExecInterface {
26 |
27 | @Override
28 | public void execute(AsyncTask task, T... args) {
29 | task.execute(args);
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/barcode/tools/common/executor/HoneycombAsyncTaskExecInterface.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 ZXing authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.yoavst.quickapps.barcode.tools.common.executor;
18 |
19 | import android.annotation.TargetApi;
20 | import android.os.AsyncTask;
21 |
22 | /**
23 | * On Honeycomb and later, {@link AsyncTask} returns to serial execution by default which is undesirable.
24 | * This calls Honeycomb-only APIs to request parallel execution.
25 | */
26 | @TargetApi(11)
27 | public final class HoneycombAsyncTaskExecInterface implements AsyncTaskExecInterface {
28 |
29 | @Override
30 | public void execute(AsyncTask task, T... args) {
31 | task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, args);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/calendar/CCalendarActivity.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.calendar
2 |
3 | import android.content.Intent
4 | import android.graphics.Color
5 | import android.os.Bundle
6 | import android.provider.CalendarContract
7 | import android.view.View
8 | import com.lge.qcircle.template.QCircleBackButton
9 | import com.lge.qcircle.template.QCircleTitle
10 | import com.yoavst.kotlin.*
11 | import com.yoavst.quickapps.R
12 | import com.yoavst.quickapps.tools.QCircleActivity
13 | import kotlinx.android.synthetic.calendar_activity.errorLayout
14 | import kotlinx.android.synthetic.calendar_activity.pager
15 | import kotlinx.android.synthetic.calendar_activity.progress
16 |
17 | /**
18 | * Created by yoavst.
19 | */
20 | public class CCalendarActivity : QCircleActivity() {
21 | var events: List? = null
22 |
23 | public fun get(position: Int): Event = events!![position]
24 |
25 |
26 | override fun onCreate(savedInstanceState: Bundle?) {
27 | super.onCreate(savedInstanceState)
28 | val title = QCircleTitle(this, getString(R.string.calendar_module_name), Color.WHITE, colorRes(R.color.md_red_500))
29 | title.setTextSize(17f)
30 | template.addElement(title)
31 | template.addElement(QCircleBackButton(this))
32 | setContentViewToMain(R.layout.calendar_activity)
33 | setContentView(template.getView())
34 | loadEvents()
35 | }
36 |
37 | fun loadEvents() {
38 | async {
39 | events = EventRetiever.getEvents(this, 30)
40 | mainThread {
41 | progress.hide()
42 | if (events == null || events!!.size() == 0) {
43 | errorLayout.show()
44 | } else {
45 | pager.show()
46 | pager.setAdapter(EventsAdapter(getFragmentManager(), events!!.size()))
47 | }
48 | }
49 | }
50 | }
51 |
52 | override fun onDestroy() {
53 | super.onDestroy()
54 | if (events is MutableList) {
55 | (events as MutableList).clear()
56 | }
57 | }
58 |
59 | override fun getIntentToShow(): Intent? {
60 | if (events == null || pager.getVisibility() == View.GONE) return null
61 | return getIntentForEvent(events!![pager.getCurrentItem()].id)
62 | }
63 |
64 | fun getIntentForEvent(id: Long): Intent {
65 | val intent = Intent(Intent.ACTION_VIEW)
66 | val builder = CalendarContract.Events.CONTENT_URI.buildUpon().appendPath(id.toString())
67 | return intent.setData(builder.build())
68 |
69 | }
70 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/calendar/CalendarFragment.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.calendar
2 |
3 | import android.app.Fragment
4 | import android.os.Bundle
5 | import android.view.LayoutInflater
6 | import android.view.View
7 | import android.view.ViewGroup
8 | import com.yoavst.kotlin.hide
9 | import com.yoavst.kotlin.show
10 | import com.yoavst.quickapps.R
11 | import com.yoavst.quickapps.tools.QCircleActivity
12 | import com.yoavst.quickapps.tools.amPmInCalendar
13 | import com.yoavst.quickapps.tools.showLocation
14 | import kotlinx.android.synthetic.calendar_fragment.*
15 |
16 | /**
17 | * Created by yoavst.
18 | */
19 | public class CalendarFragment: Fragment() {
20 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
21 | return inflater.inflate(R.layout.calendar_fragment, container, false)
22 | }
23 |
24 | override fun onViewCreated(view: View?, savedInstanceState: Bundle?) {
25 | super.onViewCreated(view, savedInstanceState)
26 | val event = (getActivity() as CCalendarActivity)[getArguments().getInt(Event)]
27 | if (Unknown == null) Unknown = getString(R.string.unknown)
28 | if (At == null) At = getString(R.string.at)
29 | view?.setOnTouchListener { v, e -> (getActivity() as QCircleActivity).gestureDetector.onTouchEvent(e) }
30 | CalendarUtil.CalendarResources.init(getActivity())
31 | title.setText(event.title)
32 | if (!getActivity().showLocation || event.location == null || event.location.length() == 0)
33 | location.setText("")
34 | else {
35 | location.setText(At + " " + event.location)
36 | }
37 | date.setText(CalendarUtil.getDateFromEvent(event, getActivity().amPmInCalendar))
38 | timeLeft.setText(CalendarUtil.getTimeToEvent(event))
39 |
40 | }
41 |
42 | companion object {
43 | var Unknown: String? = null
44 | var At: String? = null
45 | var Event: String = "event"
46 |
47 | public fun newInstance(event: Int): CalendarFragment {
48 | var fragment = CalendarFragment()
49 | var args = Bundle()
50 | args.putInt(Event, event)
51 | fragment.setArguments(args)
52 | return fragment;
53 | }
54 |
55 | }
56 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/calendar/EventRetiever.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.calendar
2 |
3 | import android.content.Context
4 | import android.text.format.Time
5 | import java.util.ArrayList
6 |
7 | /**
8 | * Created by yoavst.
9 | */
10 | public object EventRetiever {
11 | public fun getEvents(context: Context, days: Int): List {
12 | var temp = ArrayList(days * 2) // Let's hope user has less then 2 events per days for performance.
13 | val time = Time(Time.getCurrentTimezone());
14 | Event.loadEvents(context, temp, Time.getJulianDay(System.currentTimeMillis(), time.gmtoff), 30)
15 | val now = System.currentTimeMillis()
16 | return temp filter { now < it.endMillis } sortBy(comparator { l, r ->
17 | val start = (l.startMillis - r.startMillis).toInt()
18 | if (start != 0) start
19 | else {
20 | val end = (l.endMillis - r.endMillis).toInt()
21 | if (end != 0) end
22 | else l.title.toString().compareTo(r.title.toString(), ignoreCase = true)
23 | }
24 | })
25 | }
26 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/calendar/EventsAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.calendar
2 |
3 | import android.app.Fragment
4 | import android.app.FragmentManager
5 | import android.support.v13.app.FragmentStatePagerAdapter
6 |
7 |
8 | public class EventsAdapter(fm: FragmentManager, val size: Int) : FragmentStatePagerAdapter(fm) {
9 |
10 | override fun getItem(i: Int): Fragment {
11 | return CalendarFragment.newInstance(i)
12 | }
13 |
14 | override fun getCount(): Int = size
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/clock/CClockActivity.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.clock
2 |
3 | import android.content.Intent
4 | import android.graphics.Color
5 | import android.os.Bundle
6 | import com.lge.qcircle.template.QCircleBackButton
7 | import com.lge.qcircle.template.QCircleTitle
8 | import com.yoavst.kotlin.intent
9 | import com.yoavst.quickapps.R
10 | import com.yoavst.quickapps.tools.QCircleActivity
11 | import com.yoavst.quickapps.tools.isLGRom
12 | import kotlinx.android.synthetic.clock_activity.pager
13 | import kotlinx.android.synthetic.clock_activity.tabs
14 |
15 |
16 | public class CClockActivity : QCircleActivity() {
17 |
18 | override fun onCreate(savedInstanceState: Bundle?) {
19 | super.onCreate(savedInstanceState)
20 | template.addElement(QCircleBackButton(this))
21 | val title = QCircleTitle(this, getString(R.string.clock_module_name), Color.WHITE, getResources().getColor(R.color.primary))
22 | title.setTextSize(18f)
23 | title.setTitleHeight(0.14f)
24 | template.addElement(title)
25 | setContentViewToMain(R.layout.clock_activity)
26 | setContentView(template.getView())
27 | pager.setAdapter(ClockAdapter(getFragmentManager(), getString(R.string.stopwatch), getString(R.string.timer)))
28 | tabs.setupWithViewPager(pager)
29 | sendBroadcast(Intent(PhoneActivity.ACTION_FLOATING_CLOSE))
30 | if (getIntent().getBooleanExtra(TimerShowFinishing, false)) pager.setCurrentItem(1)
31 | }
32 |
33 | public override fun onPause() {
34 | super.onPause()
35 | StopwatchManager.runOnBackground()
36 | Timer.runOnBackground(this)
37 | }
38 |
39 | protected override fun getIntentToShow(): Intent? {
40 | return if (!isLGRom(this)) null else {
41 | intent().putExtra("com.lge.app.floating.launchAsFloating", true)
42 | .putExtra(PhoneActivity.EXTRA_SHOW_STOPWATCH, pager.getCurrentItem() == 0)
43 | }
44 | }
45 |
46 | companion object {
47 | public val TimerShowFinishing: String = "timerShowFinishing"
48 | }
49 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/clock/ClockAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.clock;
2 |
3 | import android.app.Fragment
4 | import android.app.FragmentManager
5 | import android.support.v13.app.FragmentPagerAdapter
6 |
7 | /**
8 | * Created by Yoav.
9 | */
10 | public class ClockAdapter(fm: FragmentManager, val stopwatch: String, val timer: String) : FragmentPagerAdapter(fm) {
11 | override fun getItem(i: Int): Fragment = if (i == 0) StopwatchFragment() else TimerFragment()
12 |
13 | override fun getPageTitle(position: Int): CharSequence? {
14 | return if (position == 0) stopwatch else timer
15 | }
16 |
17 | override fun getCount(): Int = 2
18 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/clock/StopwatchManager.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.clock
2 |
3 | import java.util.Timer
4 | import java.util.TimerTask
5 |
6 | /**
7 | * Created by Yoav.
8 | */
9 | public object StopwatchManager {
10 | public abstract class Stopwatch : TimerTask() {
11 | public synchronized var isRunning: Boolean = true
12 |
13 | override fun run() {
14 | if (isRunning) runCode()
15 | }
16 |
17 | protected abstract fun runCode()
18 | }
19 |
20 | private var runnable: (() -> Unit)? = null
21 | private var stopwatch: Stopwatch? = null
22 | private var milliseconds: Long = 0
23 | private var period: Long = 0
24 |
25 | public fun startTimer(period: Long, callback: () -> Unit) {
26 | runnable = callback
27 | StopwatchManager.period = period
28 | initStopwatch()
29 | startTimer()
30 | }
31 |
32 | private fun startTimer() {
33 | Timer().schedule(stopwatch, 10, period)
34 | }
35 |
36 | private fun initStopwatch() {
37 | stopwatch = object : Stopwatch() {
38 | override fun runCode() {
39 | milliseconds += period
40 | runnable?.invoke()
41 | }
42 | }
43 | }
44 |
45 | /**
46 | * Make the timer to run on background, with no callback
47 | */
48 | public fun runOnBackground() {
49 | runnable = null
50 | // If the stopwatch is paused, it will just save its data, and will not run.
51 | if (!(stopwatch == null || stopwatch!!.isRunning)) {
52 | stopwatch!!.cancel()
53 | stopwatch = null
54 | }
55 | }
56 |
57 | public fun runOnUi(callback: () -> Unit) {
58 | runnable = callback
59 | if (hasOldData() && stopwatch == null) {
60 | initStopwatch()
61 | stopwatch!!.isRunning = false
62 | startTimer()
63 | runnable?.invoke()
64 | }
65 | }
66 |
67 | public fun stopTimer() {
68 | runnable = null
69 | stopwatch?.cancel()
70 | stopwatch = null
71 | milliseconds = 0
72 | period = 0
73 | }
74 |
75 | public fun pauseTimer() {
76 | stopwatch?.isRunning = false
77 | }
78 |
79 | public fun resumeTimer() {
80 | stopwatch?.isRunning = true
81 | }
82 |
83 | public fun getMillis(): Long {
84 | return milliseconds
85 | }
86 |
87 | public fun isRunning(): Boolean {
88 | return stopwatch != null && stopwatch!!.isRunning
89 | }
90 |
91 | public fun hasOldData(): Boolean {
92 | return milliseconds != 0L && period != 0L
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/clock/TimerIntentService.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.clock
2 |
3 | import android.app.Notification
4 | import android.app.PendingIntent
5 | import android.app.Service
6 | import android.content.Intent
7 | import android.media.RingtoneManager
8 | import android.os.IBinder
9 | import com.yoavst.kotlin.Bundle
10 | import com.yoavst.kotlin.notificationManager
11 | import com.yoavst.kotlin.startActivity
12 | import com.yoavst.quickapps.CoverReceiver
13 | import com.yoavst.quickapps.R
14 |
15 | /**
16 | * Created by yoavst.
17 | */
18 | public class TimerIntentService : Service() {
19 | override fun onBind(intent: Intent): IBinder? {
20 | return null
21 | }
22 |
23 | override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int {
24 | Timer.runOnServer {
25 | if (Timer.timeLeft == 0L) {
26 | var alarmUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM)
27 | if (alarmUri == null) {
28 | alarmUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE)
29 | }
30 | if (CoverReceiver.isCoverInUse) {
31 | startActivity(Bundle { putBoolean(CClockActivity.TimerShowFinishing, true)})
32 | } else {
33 | val pIntent = PendingIntent.getBroadcast(this, 0, Intent("com.yoavst.empty"), 0)
34 | val notification = Notification.Builder(this)
35 | .setContentTitle(getString(R.string.timer_finished))
36 | .setSmallIcon(android.R.drawable.ic_lock_idle_alarm)
37 | .setSound(alarmUri)
38 | .setContentIntent(pIntent)
39 | .setVibrate(longArrayOf(1000, 1000, 1000, 1000, 1000))
40 | .setAutoCancel(true)
41 | .build()
42 | notificationManager().notify(NotificationId, notification)
43 | }
44 | stopSelf()
45 | }
46 | }
47 | return super.onStartCommand(intent, flags, startId)
48 | }
49 |
50 | companion object {
51 | public val NotificationId: Int = 424242
52 | }
53 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/compass/CCompassActivity.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.compass
2 |
3 | import android.content.Intent
4 | import android.os.Bundle
5 | import android.widget.ImageView
6 | import android.widget.RelativeLayout
7 | import com.lge.qcircle.template.ButtonTheme
8 | import com.lge.qcircle.template.QCircleBackButton
9 | import com.lge.qcircle.template.TemplateTag
10 | import com.yoavst.kotlin.drawableRes
11 | import com.yoavst.kotlin.intent
12 | import com.yoavst.quickapps.R
13 | import com.yoavst.quickapps.tools.QCircleActivity
14 | import com.yoavst.quickapps.tools.isLGRom
15 | import kotlin.properties.Delegates
16 |
17 | /**
18 | * Created by Yoav.
19 | */
20 | public class CCompassActivity : QCircleActivity() {
21 | var compass: Compass by Delegates.notNull()
22 |
23 | override fun onCreate(savedInstanceState: Bundle?) {
24 | super.onCreate(savedInstanceState)
25 | val backButton = QCircleBackButton(this, ButtonTheme.DARK, true)
26 | template.addElement(backButton)
27 | template.setBackgroundDrawable(drawableRes(R.drawable.compass_back))
28 | val mainLayout = template.getLayoutById(TemplateTag.CONTENT).getParent() as RelativeLayout
29 | val needle = getLayoutInflater().inflate(R.layout.compass_activity, mainLayout, false) as ImageView
30 | compass = Compass(this, needle)
31 | mainLayout.addView(needle)
32 | setContentView(template.getView())
33 | }
34 |
35 | protected override fun onResume() {
36 | super.onResume()
37 | compass.registerService()
38 | }
39 |
40 | protected override fun onPause() {
41 | super.onPause()
42 | compass.unregisterService()
43 | }
44 |
45 | protected override fun getIntentToShow(): Intent? {
46 | return if (!isLGRom(this)) null else {
47 | intent().putExtra("com.lge.app.floating.launchAsFloating", true)
48 | }
49 | }
50 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/compass/Compass.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.compass
2 |
3 | import android.content.Context
4 | import android.hardware.Sensor
5 | import android.hardware.SensorEvent
6 | import android.hardware.SensorEventListener
7 | import android.hardware.SensorManager
8 | import android.view.animation.Animation
9 | import android.view.animation.RotateAnimation
10 | import android.widget.ImageView
11 |
12 | /**
13 | * A class that get the updates on the orientation sensor and and rotate
14 | * the needle according to the change.
15 | * @author Marco Kirchner
16 | */
17 | public class Compass(context: Context, var mNeedle: ImageView) : SensorEventListener {
18 | private var currentDegree = 0.toFloat()
19 | private val mSensorManager: SensorManager
20 |
21 | init {
22 | mSensorManager = context.getSystemService(Context.SENSOR_SERVICE) as SensorManager
23 | }
24 |
25 | override fun onSensorChanged(sensorEvent: SensorEvent) {
26 | // get the angle around the z-axis rotated
27 | val degree = Math.round(sensorEvent.values[0]).toFloat()
28 | // create a rotation animation (reverse turn degree degrees)
29 | val ra = RotateAnimation(currentDegree, -degree, Animation.RELATIVE_TO_SELF, 0.5F, Animation.RELATIVE_TO_SELF, 0.5F)
30 | // how long the animation will take place
31 | ra.setDuration(210)
32 | // set the animation after the end of the reservation status
33 | ra.setFillAfter(true)
34 | // Start the animation
35 | mNeedle.startAnimation(ra)
36 | currentDegree = -degree
37 | }
38 |
39 | public fun registerService() {
40 | mSensorManager.registerListener(this, mSensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION), SensorManager.SENSOR_DELAY_GAME)
41 | }
42 |
43 | public fun unregisterService() {
44 | mSensorManager.unregisterListener(this)
45 | }
46 |
47 | override fun onAccuracyChanged(sensor: Sensor, i: Int) {
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/compass/PhoneActivity.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.compass
2 |
3 | import android.os.Bundle
4 | import android.view.ViewGroup
5 | import android.widget.ImageButton
6 | import android.widget.TextView
7 | import com.lge.app.floating.FloatableActivity
8 | import com.lge.app.floating.FloatingWindow
9 | import com.yoavst.quickapps.R
10 | import kotlinx.android.synthetic.compass_qslide_activity.needle
11 | import kotlinx.android.synthetic.compass_qslide_activity.windowBackground
12 | import kotlin.properties.Delegates
13 |
14 | public class PhoneActivity : FloatableActivity() {
15 | val compass: Compass by Delegates.lazy { Compass(this, needle) }
16 |
17 | override fun onCreate(savedInstance: Bundle?) {
18 | super.onCreate(savedInstance)
19 | setContentView(R.layout.compass_qslide_activity)
20 | }
21 |
22 | override fun onAttachedToFloatingWindow(w: FloatingWindow) {
23 | super.onAttachedToFloatingWindow(w)
24 | val window = getFloatingWindow()
25 | val layoutParams = window.getLayoutParams()
26 | layoutParams.width = 720
27 | layoutParams.height = 720
28 | layoutParams.resizeOption = FloatingWindow.ResizeOption.PROPORTIONAL
29 | window.updateLayoutParams(layoutParams)
30 | val titleText = w.findViewWithTag(FloatingWindow.Tag.TITLE_TEXT) as TextView
31 | titleText.setText(getString(R.string.compass_module_name))
32 | val titleBackground = window.findViewWithTag(FloatingWindow.Tag.TITLE_BACKGROUND)
33 | if (titleBackground != null) {
34 | windowBackground.setBackground(titleBackground.getBackground().getConstantState().newDrawable())
35 | }
36 | val fullscreenButton = w.findViewWithTag(FloatingWindow.Tag.FULLSCREEN_BUTTON) as? ImageButton
37 | if (fullscreenButton != null) {
38 | fullscreenButton.getParent() as ViewGroup removeView fullscreenButton
39 | }
40 | }
41 |
42 | override fun onPause() {
43 | super.onPause()
44 | if (!isSwitchingToFloatingMode())
45 | compass.unregisterService()
46 | }
47 |
48 | override fun onResume() {
49 | super.onResume()
50 | compass.registerService()
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/desktop/HowToFragment.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.desktop
2 |
3 | import android.app.Fragment
4 | import android.content.ComponentName
5 | import android.content.Intent
6 | import android.graphics.Color
7 | import android.graphics.drawable.BitmapDrawable
8 | import android.os.Bundle
9 | import android.view.LayoutInflater
10 | import android.view.View
11 | import android.view.ViewGroup
12 | import com.malinskiy.materialicons.IconDrawable
13 | import com.malinskiy.materialicons.Iconify
14 | import com.yoavst.kotlin.toast
15 | import com.yoavst.quickapps.R
16 | import kotlinx.android.synthetic.desktop_fragment_howto.button
17 | import kotlinx.android.synthetic.desktop_fragment_howto.image
18 |
19 | /**
20 | * Created by yoavst.
21 | */
22 | public class HowToFragment : Fragment() {
23 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
24 | return inflater.inflate(R.layout.desktop_fragment_howto, container, false)
25 | }
26 |
27 | override fun onViewCreated(view: View?, savedInstanceState: Bundle?) {
28 | super.onViewCreated(view, savedInstanceState)
29 | button.setImageDrawable(IconDrawable(getActivity(), Iconify.IconValue.md_settings).sizeDp(32).color(Color.WHITE))
30 | button.setOnClickListener {
31 | try {
32 | startActivity(Intent("android.intent.action.MAIN").setComponent(ComponentName("com.android.settings", "com.android.settings.lge.QuickWindowCase")))
33 | } catch (e: Exception) {
34 | toast(R.string.activity_not_found)
35 | }
36 | }
37 | }
38 |
39 | override fun onDestroyView() {
40 | super.onDestroyView()
41 | val drawable = (image.getDrawable() as BitmapDrawable)
42 | image.setImageDrawable(null)
43 | drawable.getBitmap().recycle()
44 | }
45 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/desktop/LaunchAdminActivity.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.desktop
2 |
3 | import android.app.Activity
4 | import android.os.Bundle
5 | import com.yoavst.quickapps.AdminListener
6 | import android.app.admin.DevicePolicyManager
7 | import android.content.Intent
8 | import android.content.ComponentName
9 | import com.yoavst.quickapps.R
10 | import android.provider.Settings
11 | import com.yoavst.kotlin.devicePolicyManager
12 |
13 | /**
14 | * Created by Yoav.
15 | */
16 | public class LaunchAdminActivity : Activity() {
17 | override fun onCreate(savedInstanceState: Bundle?) {
18 | super.onCreate(savedInstanceState)
19 | val devicePolicyManager = devicePolicyManager() as DevicePolicyManager
20 | if (!devicePolicyManager.isAdminActive(ComponentName(this, javaClass()))) {
21 | startActivity(Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN)
22 | .putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, ComponentName(this, javaClass()))
23 | .putExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION, getString(R.string.add_admin_extra_app_text)))
24 | } else {
25 | startActivity(Intent().setComponent(ComponentName("com.android.settings", "com.android.settings.DeviceAdminSettings")))
26 | }
27 | finish()
28 | }
29 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/desktop/ModulesFragment.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.desktop
2 |
3 | import android.app.Fragment
4 | import android.content.Intent
5 | import android.os.Bundle
6 | import android.view.LayoutInflater
7 | import android.view.View
8 | import android.view.ViewGroup
9 | import com.yoavst.quickapps.R
10 | import com.yoavst.quickapps.desktop.modules.DialerModuleView
11 |
12 | /**
13 | * Created by yoavst.
14 | */
15 | public class ModulesFragment : Fragment() {
16 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
17 | return inflater.inflate(R.layout.desktop_fragment_modules, container, false)
18 | }
19 |
20 | override fun onViewCreated(view: View?, savedInstanceState: Bundle?) {
21 | super.onViewCreated(view, savedInstanceState)
22 | }
23 |
24 | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
25 | super.onActivityResult(requestCode, resultCode, data)
26 | (getView().findViewById(R.id.dialer_module) as DialerModuleView).onActivityResult(requestCode, resultCode, data)
27 | }
28 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/desktop/modules/CalculatorModuleView.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.desktop.modules
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import com.yoavst.quickapps.R
6 | import com.yoavst.quickapps.desktop.BaseModuleView
7 | import com.yoavst.quickapps.tools.calculatorForceFloating
8 |
9 |
10 | public class CalculatorModuleView : BaseModuleView {
11 | public constructor(context: Context) : super(context) {
12 | }
13 |
14 | public constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
15 | }
16 |
17 | public constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
18 | }
19 |
20 | override fun init() {
21 | super.init()
22 | if (!isInEditMode()) {
23 | addSettingView(R.string.torch_force_floating, R.string.torch_force_floating_subtext, getContext().calculatorForceFloating) {
24 | getContext().calculatorForceFloating = it!!
25 | toastSuccess()
26 | }
27 | }
28 | }
29 |
30 | override fun getName(): Int = R.string.calculator_module_name
31 |
32 | override fun getIcon(): Int = R.drawable.qcircle_icon_calculator
33 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/desktop/modules/CalendarModuleView.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.desktop.modules
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import com.yoavst.quickapps.R
6 | import com.yoavst.quickapps.desktop.BaseModuleView
7 | import com.yoavst.quickapps.tools.amPmInCalendar
8 | import com.yoavst.quickapps.tools.showLocation
9 |
10 |
11 | public class CalendarModuleView : BaseModuleView {
12 | public constructor(context: Context) : super(context) {
13 | }
14 |
15 | public constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
16 | }
17 |
18 | public constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
19 | }
20 |
21 | override fun init() {
22 | super.init()
23 | if (!isInEditMode()) {
24 | addSettingView(R.string.location_title, R.string.location_subtitle, getContext().showLocation) {
25 | getContext().showLocation = it!!
26 | toastSuccess()
27 | }
28 | addSettingView(R.string.am_pm_title, R.string.am_pm_subtitle, getContext().amPmInCalendar) {
29 | getContext().amPmInCalendar = it!!
30 | toastSuccess()
31 | }
32 | }
33 | }
34 |
35 | override fun getName(): Int = R.string.calendar_module_name
36 |
37 | override fun getIcon(): Int = R.drawable.qcircle_icon_calendar
38 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/desktop/modules/ClockModuleView.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.desktop.modules
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import com.yoavst.quickapps.R
6 | import com.yoavst.quickapps.desktop.BaseModuleView
7 | import com.yoavst.quickapps.tools.stopwatchShowMillis
8 |
9 |
10 | public class ClockModuleView : BaseModuleView {
11 | public constructor(context: Context) : super(context) {
12 | }
13 |
14 | public constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
15 | }
16 |
17 | public constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
18 | }
19 |
20 | override fun init() {
21 | super.init()
22 | if (!isInEditMode()) {
23 | addSettingView(R.string.show_millis_title, R.string.show_millis_subtitle, getContext().stopwatchShowMillis) {
24 | getContext().stopwatchShowMillis = it!!
25 | toastSuccess()
26 | }
27 | }
28 | }
29 |
30 | override fun getName(): Int = R.string.clock_module_name
31 |
32 | override fun getIcon(): Int = R.drawable.qcircle_icon_clock
33 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/desktop/modules/MusicModuleView.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.desktop.modules
2 |
3 | import android.content.Context
4 | import android.content.Intent
5 | import android.util.AttributeSet
6 | import com.yoavst.quickapps.R
7 | import com.yoavst.quickapps.desktop.BaseModuleView
8 | import com.yoavst.quickapps.tools.musicOldStyle
9 |
10 |
11 | public class MusicModuleView : BaseModuleView {
12 | public constructor(context: Context) : super(context) {
13 | }
14 |
15 | public constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
16 | }
17 |
18 | public constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
19 | }
20 |
21 | override fun init() {
22 | super.init()
23 | if (!isInEditMode()) {
24 | addSettingView(R.string.music_listener_title, R.string.music_listener_subtitle) {
25 | getContext().startActivity(Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"))
26 | }
27 | addSettingView(R.string.music_show_old_title, R.string.music_show_old_subtitle, getContext().musicOldStyle) {
28 | getContext().musicOldStyle = it!!
29 | toastSuccess()
30 | }
31 | }
32 | }
33 |
34 | override fun getName(): Int = R.string.music_module_name
35 |
36 | override fun getIcon(): Int = R.drawable.qcircle_icon_music
37 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/desktop/modules/NewsModuleView.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.desktop.modules
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import com.yoavst.kotlin.toast
6 | import com.yoavst.quickapps.R
7 | import com.yoavst.quickapps.desktop.BaseModuleView
8 | import com.yoavst.quickapps.tools.*
9 |
10 |
11 | public class NewsModuleView : BaseModuleView {
12 | public constructor(context: Context) : super(context) {
13 | }
14 |
15 | public constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
16 | }
17 |
18 | public constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
19 | }
20 |
21 | override fun init() {
22 | super.init()
23 | if (!isInEditMode()) {
24 | addSettingView(R.string.news_logout_feedly) {
25 | getContext().userId = ""
26 | getContext().refreshToken = ""
27 | getContext().accessToken = ""
28 | getContext().rawResponse = ""
29 | getContext().feed = ""
30 | getContext().lastUpdateTime = 0
31 | getContext().toast(R.string.news_logout_feedly)
32 | }
33 | }
34 | }
35 |
36 | override fun getName(): Int = R.string.news_module_name
37 |
38 | override fun getIcon(): Int = R.drawable.qcircle_icon_news
39 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/desktop/modules/NotificationsModuleView.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.desktop.modules
2 |
3 | import android.content.Context
4 | import android.content.Intent
5 | import android.util.AttributeSet
6 | import com.yoavst.quickapps.R
7 | import com.yoavst.quickapps.desktop.BaseModuleView
8 | import com.yoavst.quickapps.tools.amPmInNotifications
9 | import com.yoavst.quickapps.tools.notificationShowContent
10 | import com.yoavst.quickapps.tools.startActivityOnNotification
11 |
12 | /**
13 | * Created by yoavst.
14 | */
15 | public class NotificationsModuleView: BaseModuleView {
16 |
17 | public constructor(context: Context) : super(context) {
18 | }
19 |
20 | public constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
21 | }
22 |
23 | public constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
24 | }
25 |
26 | override fun init() {
27 | super.init()
28 | if (!isInEditMode()) {
29 | addSettingView(R.string.music_listener_title, R.string.music_listener_subtitle) {
30 | getContext().startActivity(Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"))
31 | }
32 | addSettingView(R.string.privacy_title, R.string.privacy_subtitle, getContext().notificationShowContent) {
33 | getContext().notificationShowContent = it!!
34 | toastSuccess()
35 | }
36 | addSettingView(R.string.auto_launch_title, R.string.auto_launch_subtitle, getContext().startActivityOnNotification) {
37 | getContext().startActivityOnNotification = it!!
38 | toastSuccess()
39 | }
40 | addSettingView(R.string.am_pm_title, R.string.am_pm_subtitle, getContext().amPmInNotifications) {
41 | getContext().amPmInNotifications = it!!
42 | toastSuccess()
43 | }
44 | }
45 | }
46 |
47 | override fun getName(): Int = R.string.notification_module_name
48 |
49 | override fun getIcon(): Int = R.drawable.qcircle_icon_notifications
50 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/dialer/ContactsAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.dialer
2 |
3 | import android.support.v7.widget.RecyclerView
4 | import android.telephony.PhoneNumberUtils
5 | import android.util.TypedValue
6 | import android.view.LayoutInflater
7 | import android.view.View
8 | import android.view.ViewGroup
9 | import android.widget.TextView
10 | import com.yoavst.kotlin.telephonyManager
11 | import com.yoavst.quickapps.dialer.ContactsAdapter.VH
12 |
13 |
14 | public class ContactsAdapter(activity: CDialerActivity, val callback: (number: String) -> Unit) : RecyclerView.Adapter() {
15 | val items = activity.phones
16 | val iso = activity.telephonyManager().getSimCountryIso().toUpperCase().trim()
17 |
18 | override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): VH? {
19 | val layout = LayoutInflater.from(parent!!.getContext()).inflate(android.R.layout.simple_list_item_2, parent, false)
20 | val outValue = TypedValue()
21 | parent.getContext().getTheme().resolveAttribute(android.R.attr.selectableItemBackground, outValue, true)
22 | layout.setBackgroundResource(outValue.resourceId)
23 | return VH(layout)
24 |
25 | }
26 |
27 | override fun onBindViewHolder(holder: VH?, position: Int) {
28 | val item = items.get(position)
29 | val number = PhoneNumberUtils.formatNumber(item.parsed?.getRawInput() ?: item.name, iso)
30 | holder!!.itemView.setTag(number)
31 | holder.title.setText(item.name)
32 | holder.number.setText(number)
33 | holder.itemView.setOnClickListener { callback((it.getTag() as? String).orEmpty()) }
34 | }
35 |
36 | override fun getItemCount(): Int = items.size()
37 |
38 | class VH(itemView: View) : RecyclerView.ViewHolder(itemView) {
39 | public val title: TextView
40 | public val number: TextView
41 |
42 | init {
43 | title = itemView.findViewById(android.R.id.text1) as TextView
44 | number = itemView.findViewById(android.R.id.text2) as TextView
45 | }
46 | }
47 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/dialer/ContactsFragment.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.dialer
2 |
3 | import android.app.Fragment
4 | import android.content.Intent
5 | import android.net.Uri
6 | import android.os.Bundle
7 | import android.support.v7.widget.LinearLayoutManager
8 | import android.support.v7.widget.RecyclerView
9 | import android.view.LayoutInflater
10 | import android.view.View
11 | import android.view.ViewGroup
12 | import com.yoavst.kotlin.toPx
13 | import com.yoavst.quickapps.tools.DividerItemDecoration
14 |
15 | /**
16 | * Created by Yoav.
17 | */
18 | public class ContactsFragment : Fragment() {
19 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
20 | val recycler = RecyclerView(getActivity())
21 | recycler.setPadding(32.toPx(getActivity()), 0, 32.toPx(getActivity()), 0)
22 | recycler.setLayoutManager(LinearLayoutManager(getActivity()))
23 | recycler.setAdapter(ContactsAdapter(getActivity() as CDialerActivity) {
24 | if (it.isNotEmpty())
25 | startActivity(Intent(Intent.ACTION_CALL, Uri.parse("tel:" + it)))
26 | })
27 | recycler.addItemDecoration(DividerItemDecoration(getActivity(), null))
28 | return recycler
29 | }
30 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/dialer/DialerAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.dialer
2 |
3 | import android.app.FragmentManager
4 | import android.content.Context
5 | import android.support.v13.app.FragmentPagerAdapter
6 | import android.app.Fragment
7 |
8 | /**
9 | * Created by Yoav.
10 | */
11 | public class DialerAdapter(fm: FragmentManager) : FragmentPagerAdapter(fm) {
12 | override fun getItem(i: Int): Fragment {
13 | return if (i == 0) DialerFragment() else ContactsFragment()
14 | }
15 |
16 | override fun getCount(): Int = 2
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/dialer/PhoneNumberWrapper.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.dialer
2 |
3 | import com.google.i18n.phonenumbers.Phonenumber
4 |
5 | public data class PhoneNumberWrapper(val name: String, var number: String? = null, val parsed: Phonenumber.PhoneNumber? = null)
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/launcher/LauncherDeSerializer.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.launcher
2 |
3 | import com.google.gson.JsonDeserializationContext
4 | import com.google.gson.JsonDeserializer
5 | import com.google.gson.JsonElement
6 | import com.google.gson.JsonObject
7 | import com.google.gson.JsonParseException
8 | import com.google.gson.JsonSerializationContext
9 | import com.google.gson.JsonSerializer
10 |
11 | import java.lang.reflect.Type
12 |
13 | /**
14 | * Created by Yoav.
15 | */
16 | public class LauncherDeSerializer : JsonDeserializer, JsonSerializer {
17 | throws(JsonParseException::class)
18 | override fun deserialize(json: JsonElement, typeOfT: Type, context: JsonDeserializationContext): ListItem {
19 | val jsonObject = json.getAsJsonObject()
20 | val name = jsonObject.get("name").getAsString()
21 | val activity = if (jsonObject.has("activity-name")) jsonObject.get("activity-name").getAsString() else ""
22 | val enabled = !jsonObject.has("enabled") || jsonObject.get("enabled").getAsBoolean()
23 | return ListItem(name, activity, enabled)
24 | }
25 |
26 | override fun serialize(src: ListItem, typeOfSrc: Type, context: JsonSerializationContext): JsonElement {
27 | val jsonObject = JsonObject()
28 | jsonObject.addProperty("name", src.name)
29 | jsonObject.addProperty("enabled", src.enabled)
30 | jsonObject.addProperty("activity-name", src.activity)
31 | return jsonObject
32 | }
33 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/launcher/ListItem.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.launcher
2 |
3 | import android.graphics.drawable.Drawable
4 |
5 | public class ListItem(public var name: String, public var activity: String, public var enabled: Boolean, public var icon: Int = 0): Comparable {
6 | override fun compareTo(other: ListItem): Int = name.compareTo(other.name)
7 | override fun hashCode(): Int {
8 | return activity.hashCode() + 29
9 | }
10 |
11 | override fun equals(other: Any?): Boolean {
12 | if (other == null) {
13 | return false
14 | }
15 | if (other === this) {
16 | return true
17 | }
18 | if (other is ListItem) {
19 | if (this.activity == other.activity) {
20 | return true
21 | }
22 | }
23 | return false
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/music/PlayPauseView.java:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.music;
2 |
3 | import android.content.Context;
4 | import android.content.res.ColorStateList;
5 | import android.support.design.widget.FloatingActionButton;
6 | import android.util.AttributeSet;
7 |
8 | import com.yoavst.quickapps.R;
9 |
10 | /**
11 | * A simple fab that switches between play and pause states
12 | */
13 | public class PlayPauseView extends FloatingActionButton {
14 | public PlayPauseView(Context context) {
15 | super(context);
16 | setPausing();
17 | }
18 |
19 | public PlayPauseView(Context context, AttributeSet attrs) {
20 | super(context, attrs);
21 | setPausing();
22 | }
23 |
24 | public PlayPauseView(Context context, AttributeSet attrs, int defStyleAttr) {
25 | super(context, attrs, defStyleAttr);
26 | setPausing();
27 | }
28 |
29 | /**
30 | * Sets pause mode look for fab.
31 | */
32 | public void setPausing() {
33 | setBackgroundTintList(ColorStateList.valueOf(getResources().getColor(R.color.primary)));
34 | setImageResource(R.drawable.ic_play);
35 | }
36 |
37 | /**
38 | * Sets play mode look for fab.
39 | */
40 | public void setPlaying() {
41 | setBackgroundTintList(ColorStateList.valueOf(getResources().getColor(R.color.accent)));
42 | setImageResource(R.drawable.ic_pause);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/news/FeedlyApi.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.news
2 |
3 | import org.scribe.builder.api.DefaultApi20
4 | import org.scribe.extractors.AccessTokenExtractor
5 | import org.scribe.extractors.JsonTokenExtractor
6 | import org.scribe.model.OAuthConfig
7 | import org.scribe.model.Verb
8 | import org.scribe.utils.OAuthEncoder
9 |
10 | /**
11 | * Created by Yoav.
12 | */
13 | public class FeedlyApi : DefaultApi20() {
14 |
15 | override fun getAccessTokenEndpoint(): String {
16 | return ACCESS_TOKEN_URL
17 | }
18 |
19 | override fun getAuthorizationUrl(config: OAuthConfig): String {
20 | return AUTHORIZE_URL.format(config.getApiKey(), OAuthEncoder.encode(config.getCallback()), config.getScope())
21 | }
22 |
23 | override fun getAccessTokenVerb(): Verb {
24 | return Verb.POST
25 | }
26 |
27 | override fun getAccessTokenExtractor(): AccessTokenExtractor {
28 | return JsonTokenExtractor()
29 | }
30 |
31 | companion object {
32 | public var AUTHORIZE_URL: String = "https://cloud.feedly.com/v3/auth/auth?client_id=%s&redirect_uri=%s&response_type=code&scope=%s"
33 | public var ACCESS_TOKEN_URL: String = "https://cloud.feedly.com/v3/auth/token?grant_type=authorization_code"
34 | public val SCOPE: String = "https://cloud.feedly.com/subscriptions"
35 | }
36 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/news/NewsAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.news
2 |
3 | import android.app.Fragment
4 | import android.app.FragmentManager
5 | import android.support.v13.app.FragmentPagerAdapter
6 | import android.support.v13.app.FragmentStatePagerAdapter
7 | import com.yoavst.kotlin.e
8 |
9 | import com.yoavst.quickapps.news.types.Entry
10 |
11 |
12 | import java.util.ArrayList
13 |
14 | /**
15 | * Created by Yoav.
16 | */
17 | public class NewsAdapter(fm: FragmentManager, val size: Int) : FragmentStatePagerAdapter(fm) {
18 |
19 | override fun getItem(i: Int): Fragment {
20 | return NewsFragment.newInstance(i)
21 | }
22 |
23 | override fun getCount(): Int = size
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/news/NewsFragment.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.news
2 |
3 | import android.annotation.SuppressLint
4 | import android.app.Fragment
5 | import android.os.Bundle
6 | import android.view.LayoutInflater
7 | import android.view.View
8 | import android.view.ViewGroup
9 | import com.yoavst.quickapps.R
10 | import com.yoavst.quickapps.tools.QCircleActivity
11 | import kotlinx.android.synthetic.news_fragment.source
12 | import kotlinx.android.synthetic.news_fragment.time
13 | import kotlinx.android.synthetic.news_fragment.title
14 | import java.text.SimpleDateFormat
15 | import java.util.Date
16 | import kotlin.properties.Delegates
17 |
18 | /**
19 | * Created by Yoav.
20 | */
21 | public class NewsFragment : Fragment() {
22 |
23 | val entryNumber by Delegates.lazy { getArguments().getInt(ENTRY_NUMBER) }
24 |
25 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
26 | return inflater.inflate(R.layout.news_fragment, container, false)
27 | }
28 |
29 | override fun onViewCreated(view: View?, savedInstanceState: Bundle?) {
30 | view!!.setOnTouchListener { view, motionEvent -> (getActivity() as QCircleActivity).gestureDetector.onTouchEvent(motionEvent) }
31 | val entry = (getActivity() as CNewsActivity)[entryNumber]
32 | title.setText(entry.getTitle())
33 | source.setText(entry.getOrigin().getTitle())
34 | time.setText(dayFormatter.format(Date(entry.getPublished())))
35 |
36 | }
37 |
38 | companion object {
39 | SuppressLint("SimpleDateFormat")
40 | private val dayFormatter = SimpleDateFormat("MMM d, HH:mm")
41 | private var ENTRY_NUMBER: String = "ENTRY_NUMBER"
42 |
43 | public fun newInstance(entryNumber: Int): NewsFragment {
44 | var fragment = NewsFragment()
45 | var args = Bundle()
46 | args.putInt(ENTRY_NUMBER, entryNumber)
47 | fragment.setArguments(args)
48 | return fragment
49 | }
50 | }
51 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/news/types/AuthResponse.java:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.news.types;
2 |
3 | import com.google.gson.annotations.Expose;
4 | import com.google.gson.annotations.SerializedName;
5 |
6 | /**
7 | * Created by Yoav.
8 | */
9 | public class AuthResponse{
10 | @SerializedName("access_token")
11 | @Expose
12 | private String accessToken;
13 | @SerializedName("refresh_token")
14 | @Expose
15 | private String refreshToken;
16 | @SerializedName("token_type")
17 | @Expose
18 | private String tokenType;
19 | @SerializedName("expires_in")
20 | @Expose
21 | private int expiresIn;
22 | @Expose
23 | private String plan;
24 | @Expose
25 | private String id;
26 | @Expose
27 | private String provider;
28 |
29 | public String getAccessToken() {
30 | return accessToken;
31 | }
32 |
33 | public void setAccessToken(String accessToken) {
34 | this.accessToken = accessToken;
35 | }
36 |
37 | public String getRefreshToken() {
38 | return refreshToken;
39 | }
40 |
41 | public void setRefreshToken(String refreshToken) {
42 | this.refreshToken = refreshToken;
43 | }
44 |
45 | public String getTokenType() {
46 | return tokenType;
47 | }
48 |
49 | public void setTokenType(String tokenType) {
50 | this.tokenType = tokenType;
51 | }
52 |
53 | public int getExpiresIn() {
54 | return expiresIn;
55 | }
56 |
57 | public void setExpiresIn(int expiresIn) {
58 | this.expiresIn = expiresIn;
59 | }
60 |
61 | public String getPlan() {
62 | return plan;
63 | }
64 |
65 | public void setPlan(String plan) {
66 | this.plan = plan;
67 | }
68 |
69 | public String getId() {
70 | return id;
71 | }
72 |
73 | public void setId(String id) {
74 | this.id = id;
75 | }
76 |
77 | public String getProvider() {
78 | return provider;
79 | }
80 |
81 | public void setProvider(String provider) {
82 | this.provider = provider;
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/notifications/NotificationAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.notifications
2 |
3 | import android.app.Fragment
4 | import android.app.FragmentManager
5 | import android.support.v13.app.FragmentStatePagerAdapter
6 | import android.util.SparseArray
7 | import android.view.ViewGroup
8 | import android.support.v4.view.PagerAdapter
9 |
10 | /**
11 | * Created by Yoav.
12 | */
13 | public class NotificationAdapter(fm: FragmentManager) : FragmentStatePagerAdapter(fm) {
14 | private val activeFragments = SparseArray(3)
15 |
16 | override fun getItemPosition(any: Any): Int {
17 | return PagerAdapter.POSITION_NONE
18 | }
19 |
20 | override fun getItem(i: Int): Fragment {
21 | val fragment: Fragment
22 | try {
23 | fragment = NotificationsFragment.newInstance(NotificationsManager.notifications!!.get(i))
24 | } catch (e: Exception) {
25 | fragment = NotificationsFragment()
26 | }
27 |
28 | activeFragments.put(i, fragment)
29 | return fragment
30 | }
31 |
32 | override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
33 | try {
34 | super.destroyItem(container, position, `object`)
35 | activeFragments.remove(position)
36 | } catch (ignored: Exception) {
37 | }
38 |
39 | }
40 |
41 | override fun getCount(): Int {
42 | return if (NotificationsManager.notifications == null) 0 else NotificationsManager.notifications!!.size()
43 | }
44 |
45 | public fun getActiveFragment(index: Int): Fragment? {
46 | return if (getCount() != 0) activeFragments.get(index) else null
47 | }
48 |
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/simon/OppositeSemiCircleView.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.simon
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.widget.ImageView
6 |
7 | import com.yoavst.quickapps.R
8 |
9 | public class OppositeSemiCircleView : ImageView {
10 |
11 | public constructor(context: Context) : super(context) {
12 | }
13 |
14 | public constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
15 | }
16 |
17 | public constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
18 | }
19 |
20 | init {
21 | setBackground(SemiCircleDrawable(getResources().getColor(R.color.md_deep_purple_A200), SemiCircleDrawable.Direction.RIGHT))
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/simon/SemiCircleDrawable.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.simon
2 |
3 | import android.graphics.Canvas
4 | import android.graphics.Color
5 | import android.graphics.ColorFilter
6 | import android.graphics.Paint
7 | import android.graphics.RectF
8 | import android.graphics.drawable.Drawable
9 |
10 | public class SemiCircleDrawable(color: Int = Color.BLUE, private val angle: SemiCircleDrawable.Direction = SemiCircleDrawable.Direction.LEFT) : Drawable() {
11 |
12 | private val paint: Paint
13 | private val rectF: RectF
14 | public var color: Int = 0
15 | private set(color: Int) {
16 | $color = color
17 | paint.setColor($color)
18 | }
19 |
20 | public enum class Direction {
21 | LEFT,
22 | RIGHT,
23 | TOP,
24 | BOTTOM
25 | }
26 |
27 | init {
28 | paint = Paint()
29 | paint.setStyle(Paint.Style.FILL)
30 | rectF = RectF()
31 | this.color = color
32 | }
33 |
34 |
35 | override fun draw(canvas: Canvas) {
36 | canvas.save()
37 |
38 | val bounds = getBounds()
39 |
40 | if (angle == Direction.LEFT || angle == Direction.RIGHT) {
41 | canvas.scale(2F, 1F)
42 | if (angle == Direction.RIGHT) {
43 | canvas.translate((-(bounds.right / 2)).toFloat(), 0F)
44 | }
45 | } else {
46 | canvas.scale(1F, 2F)
47 | if (angle == Direction.BOTTOM) {
48 | canvas.translate(0F, (-(bounds.bottom / 2)).toFloat())
49 | }
50 | }
51 |
52 |
53 | rectF.set(bounds)
54 |
55 | if (angle == Direction.LEFT)
56 | canvas.drawArc(rectF, 90F, 180F, true, paint)
57 | else if (angle == Direction.TOP)
58 | canvas.drawArc(rectF, -180F, 180F, true, paint)
59 | else if (angle == Direction.RIGHT)
60 | canvas.drawArc(rectF, 270F, 180F, true, paint)
61 | else if (angle == Direction.BOTTOM)
62 | canvas.drawArc(rectF, 0F, 180F, true, paint)
63 | }
64 |
65 | override fun setAlpha(alpha: Int) {
66 | // Has no effect
67 | }
68 |
69 | override fun setColorFilter(cf: ColorFilter) {
70 | // Has no effect
71 | }
72 |
73 | override fun getOpacity(): Int {
74 | // Not Implemented
75 | return 0
76 | }
77 |
78 | }
79 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/simon/SemiCircleView.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.simon
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.widget.ImageView
6 | import com.yoavst.quickapps.R
7 |
8 | /**
9 | * Created by Yoav.
10 | */
11 | public class SemiCircleView : ImageView {
12 |
13 | public constructor(context: Context) : super(context) {
14 | }
15 |
16 | public constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
17 | }
18 |
19 | public constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
20 | }
21 |
22 | init {
23 | setBackground(SemiCircleDrawable(getResources().getColor(R.color.md_pink_A200), SemiCircleDrawable.Direction.LEFT))
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/simon/SimonGame.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.simon
2 |
3 | import java.util.ArrayList
4 | import java.util.Random
5 | import kotlin.properties.Delegates
6 |
7 | public class SimonGame {
8 | var colors = ArrayList()
9 | var ongoingColors: ArrayList by Delegates.notNull()
10 | var position: Int = 0
11 |
12 | enum class Color {
13 | Red,
14 | Blue,
15 | Green,
16 | Yellow;
17 |
18 | companion object {
19 | public fun generate(): Color {
20 | return generateFrom(random.nextInt(4))
21 | }
22 |
23 | public fun generateFrom(num: Int): Color {
24 | when (num) {
25 | 0 -> return Red
26 | 1 -> return Blue
27 | 2 -> return Green
28 | else -> return Yellow
29 | }
30 | }
31 | }
32 | }
33 |
34 | fun generateNext(): ArrayList {
35 | position = 0
36 | ongoingColors = ArrayList()
37 | colors.add(Color.generate())
38 | return colors
39 | }
40 |
41 | fun press(color: Color): Boolean? {
42 | if (colors.size() <= ongoingColors.size())
43 | return null
44 | else {
45 | ongoingColors.add(color)
46 | val b = color == colors.get(position)
47 | position++
48 | return if (b && colors.size() <= position) null else b
49 | }
50 | }
51 |
52 | fun getRound(): Int {
53 | return colors.size()
54 | }
55 |
56 | companion object {
57 | var random = Random()
58 | }
59 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/toggles/CTogglesActivity.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.toggles
2 |
3 | import android.content.Intent
4 | import android.graphics.Color
5 | import android.os.Bundle
6 | import android.support.v4.view.ViewPager
7 | import com.lge.qcircle.template.QCircleBackButton
8 | import com.lge.qcircle.template.QCircleTitle
9 | import com.yoavst.kotlin.broadcastReceiver
10 | import com.yoavst.kotlin.colorRes
11 | import com.yoavst.quickapps.R
12 | import com.yoavst.quickapps.tools.QCircleActivity
13 | import kotlin.properties.Delegates
14 |
15 | /**
16 | * Created by Yoav.
17 | */
18 | public class CTogglesActivity : QCircleActivity() {
19 | val pager: ViewPager by Delegates.lazy {
20 | val localPager = ViewPager(this)
21 | localPager.setId(R.id.pager)
22 | localPager.setOffscreenPageLimit(10)
23 | localPager.setAdapter(TogglesAdapter(getFragmentManager(), this))
24 | localPager
25 | }
26 |
27 | protected override fun onCreate(savedInstanceState: Bundle?) {
28 | super.onCreate(savedInstanceState)
29 | val title = QCircleTitle(this, getString(R.string.toggles_module_name), Color.WHITE, colorRes(R.color.md_indigo_700))
30 | title.setTextSize(17f)
31 | template.addElement(title)
32 | template.addElement(QCircleBackButton(this))
33 | setContentViewToMain(pager)
34 | setContentView(template.getView())
35 | }
36 |
37 | override fun getIntentToShow(): Intent? {
38 | return (getFragmentManager().findFragmentByTag("android:switcher:" + R.id.pager + ":" + pager.getCurrentItem()) as ToggleFragment)
39 | .getIntentForLaunch().addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/toggles/ToggleFragment.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.toggles
2 |
3 | import android.app.Fragment
4 | import android.content.Intent
5 | import android.content.res.ColorStateList
6 | import android.graphics.Color
7 | import android.os.Bundle
8 | import android.view.LayoutInflater
9 | import android.view.View
10 | import android.view.ViewGroup
11 | import android.widget.RelativeLayout
12 | import com.yoavst.kotlin.colorResource
13 | import com.yoavst.quickapps.R
14 | import com.yoavst.quickapps.tools.QCircleActivity
15 | import kotlinx.android.synthetic.toggles_toggle_fragment.*
16 |
17 | /**
18 | * Created by Yoav.
19 | */
20 | public abstract class ToggleFragment : Fragment() {
21 | val colorOn by colorResource(R.color.color_toggle_on)
22 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
23 | val relativeLayout = inflater.inflate(R.layout.toggles_toggle_fragment, container, false) as RelativeLayout
24 | relativeLayout.setOnTouchListener { v, e -> (getActivity() as QCircleActivity).gestureDetector.onTouchEvent(e) }
25 | return relativeLayout
26 | }
27 |
28 | override fun onViewCreated(view: View?, savedInstanceState: Bundle?) {
29 | super.onViewCreated(view, savedInstanceState)
30 | image.setOnClickListener { onToggleButtonClicked() }
31 | title.setText(getTitle())
32 | init()
33 | }
34 |
35 | fun setToggleBackgroundOn() {
36 | setToggleBackground(colorOn)
37 | }
38 |
39 | fun setToggleBackground(color: Int) {
40 | image.setBackgroundTintList(ColorStateList.valueOf(color))
41 | imageAnimation?.setBackgroundTintList(ColorStateList.valueOf(color))
42 | }
43 |
44 | fun setToggleBackgroundOff() {
45 | setToggleBackground(Color.BLACK)
46 | }
47 |
48 | public abstract fun onToggleButtonClicked()
49 |
50 | public abstract fun getIntentForLaunch(): Intent
51 |
52 | public abstract fun init()
53 |
54 | public abstract fun getTitle(): CharSequence
55 | }
56 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/toggles/ToggleItem.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.toggles
2 |
3 |
4 | public data class ToggleItem(public val id: Int, public val name: String) {
5 | companion object {
6 | public val Wifi: Int = 0
7 | public val Brightness: Int = 1
8 | public val Sound: Int = 2
9 | public val Bluetooth: Int = 3
10 | public val Hotspot: Int = 4
11 | }
12 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/toggles/TogglesAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.toggles
2 |
3 | import android.app.Fragment
4 | import android.app.FragmentManager
5 | import android.content.Context
6 | import android.support.v13.app.FragmentPagerAdapter
7 | import com.google.gson.Gson
8 | import com.yoavst.quickapps.R
9 | import com.yoavst.quickapps.toggles.toggles.*
10 | import com.yoavst.quickapps.tools.showBatteryToggle
11 | import com.yoavst.quickapps.tools.togglesItems
12 | import com.yoavst.quickapps.tools.typeToken
13 | import java.lang.reflect.Type
14 | import java.util.ArrayList
15 |
16 |
17 | public class TogglesAdapter(fm: FragmentManager, context: Context) : FragmentPagerAdapter(fm) {
18 | val showBattery = context.showBatteryToggle
19 | val items: List
20 |
21 | init {
22 | val localItems = if (context.togglesItems != "-1")
23 | Gson().fromJson(context.togglesItems, listType)
24 | else
25 | initDefaultToggles(context)
26 | items = localItems
27 | }
28 |
29 | override fun getItem(position: Int): Fragment {
30 | if (showBattery && position == 0) return BatteryFragment()
31 | else return getFragment(items[if (showBattery) position - 1 else position].id)
32 | }
33 |
34 | fun getFragment(id: Int): Fragment {
35 | return when (id) {
36 | ToggleItem.Bluetooth -> BluetoothFragment()
37 | ToggleItem.Brightness -> BrightnessFragment()
38 | ToggleItem.Hotspot -> HotspotFragment()
39 | ToggleItem.Sound -> SoundFragment()
40 | ToggleItem.Wifi -> WifiFragment()
41 | else -> Fragment()
42 | }
43 | }
44 |
45 | override fun getCount(): Int = items.size() + if (showBattery) 1 else 0
46 |
47 | companion object {
48 | public var listType: Type = typeToken>()
49 |
50 | public fun initDefaultToggles(context: Context): ArrayList {
51 | val toggles = context.getResources().getStringArray(R.array.toggles)
52 | val items = ArrayList(toggles.size())
53 | for (i in toggles.indices) {
54 | items.add(ToggleItem(i, toggles[i]))
55 | }
56 | context.togglesItems = Gson().toJson(items, listType)
57 | return items
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/toggles/TogglesListAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.toggles
2 |
3 | import android.support.v7.widget.RecyclerView
4 | import android.view.LayoutInflater
5 | import android.view.View
6 | import android.view.ViewGroup
7 | import android.widget.TextView
8 | import com.yoavst.quickapps.R
9 | import com.yoavst.quickapps.toggles.TogglesListAdapter.VH
10 |
11 | /**
12 | * Created by Yoav.
13 | */
14 | public class TogglesListAdapter(val items: List) : RecyclerView.Adapter() {
15 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): VH {
16 | return VH(LayoutInflater.from(parent.getContext()).inflate(R.layout.desktop_toggle_item, parent, false))
17 | }
18 |
19 | override fun onBindViewHolder(holder: VH, position: Int) {
20 | val item = items.get(position)
21 | holder.title.setText(item.name)
22 | }
23 |
24 | override fun getItemCount(): Int = items.size()
25 |
26 | class VH(itemView: View) : RecyclerView.ViewHolder(itemView) {
27 | public val title: TextView
28 |
29 | init {
30 | title = itemView.findViewById(android.R.id.text1) as TextView
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/toggles/toggles/HotspotFragment.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.toggles.toggles
2 |
3 | import android.content.ComponentName
4 | import android.content.Intent
5 | import com.yoavst.kotlin.drawableResource
6 | import com.yoavst.kotlin.stringResource
7 | import com.yoavst.quickapps.R
8 | import com.yoavst.quickapps.toggles.Connectivity
9 | import com.yoavst.quickapps.toggles.ToggleFragment
10 | import kotlinx.android.synthetic.toggles_toggle_fragment.*
11 | /**
12 | * Created by yoavst.
13 | */
14 | public class HotspotFragment : ToggleFragment() {
15 | val Off by stringResource(R.string.hotSpot_off)
16 | val On by stringResource(R.string.hotSpot_on)
17 | val OnDrawable by drawableResource(R.drawable.ic_wifi_tethering)
18 | val OffDrawable by drawableResource(R.drawable.ic_wifi_tethering_off)
19 | var enabled: Boolean = false
20 |
21 | override fun onToggleButtonClicked() {
22 | enabled = !enabled
23 | setToggleData(enabled)
24 | Connectivity.configApState(getActivity())
25 | }
26 |
27 | override fun getIntentForLaunch(): Intent {
28 | val intent = Intent(Intent.ACTION_MAIN, null)
29 | intent.addCategory(Intent.CATEGORY_LAUNCHER)
30 | val cn = ComponentName("com.android.settings", "com.android.settings.TetherSettings")
31 | intent.setComponent(cn)
32 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
33 | return intent
34 | }
35 |
36 | fun setToggleData(enabled: Boolean) {
37 | if (enabled) {
38 | image.setImageDrawable(OnDrawable)
39 | setToggleBackgroundOn()
40 | text.setText(On)
41 | } else {
42 | image.setImageDrawable(OffDrawable)
43 | setToggleBackgroundOff()
44 | text.setText(Off)
45 | }
46 | }
47 |
48 | override fun init() {
49 | enabled = Connectivity.isApOn(getActivity())
50 | setToggleData(enabled)
51 | }
52 |
53 | override fun getTitle(): CharSequence = getString(R.string.hotSpot)
54 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/tools/BaseAnimationListener.java:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.tools;
2 |
3 | import android.animation.Animator;
4 | import android.support.annotation.NonNull;
5 |
6 | public class BaseAnimationListener implements Animator.AnimatorListener {
7 | @Override
8 | public void onAnimationStart(Animator animation) {
9 |
10 | }
11 |
12 | @Override
13 | public void onAnimationEnd(@NonNull Animator animation) {
14 |
15 | }
16 |
17 | @Override
18 | public void onAnimationCancel(Animator animation) {
19 |
20 | }
21 |
22 | @Override
23 | public void onAnimationRepeat(Animator animation) {
24 |
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/tools/EmptyReceiver.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.tools
2 |
3 | import android.content.BroadcastReceiver
4 | import android.content.Context
5 | import android.content.Intent
6 |
7 | /**
8 | * Created by yoavst.
9 | */
10 | public class EmptyReceiver: BroadcastReceiver() {
11 | override fun onReceive(context: Context?, intent: Intent?) {
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/tools/viewanimations/ShakeAnimator.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * The MIT License (MIT)
3 | *
4 | * Copyright (c) 2014 daimajia
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.yoavst.quickapps.tools.viewanimations
26 |
27 |
28 | import android.animation.ObjectAnimator
29 | import android.view.View
30 |
31 | public class ShakeAnimator : BaseViewAnimator() {
32 | var bigShake = false
33 |
34 | override fun prepare(target: View) {
35 | val translationX = ObjectAnimator.ofFloat(target, "translationX", 0F, 25F, -25F, 25F, -25F, 15F, -15F, 6F, -6F, 0F)
36 | val translationY = ObjectAnimator.ofFloat(target, "translationY", 0F, 25F, -25F, 25F, -25F, 15F, -15F, 6F, -6F, 0F)
37 | if (!bigShake)
38 | animatorAgent.playTogether(translationX)
39 | else animatorAgent.playTogether(translationX, translationY)
40 |
41 | }
42 |
43 | companion object {
44 | public fun getBigShake(): ShakeAnimator {
45 | val animator = ShakeAnimator()
46 | animator.bigShake = true
47 | return animator
48 | }
49 | }
50 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/torch/KitkatCameraManagerImpl.java:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.torch;
2 |
3 | import android.graphics.SurfaceTexture;
4 | import android.hardware.Camera;
5 | import android.os.Build;
6 |
7 | import java.io.IOException;
8 |
9 | /**
10 | * Implementation for camera manager using deprecated Kitkat and below APIs.
11 | */
12 | public class KitkatCameraManagerImpl extends CameraManager.CameraManagerImpl {
13 | private Camera mCamera;
14 | private Camera.Parameters mParameters;
15 |
16 | @Override
17 | public void init() {
18 | if (mCamera == null) {
19 | mCamera = Camera.open();
20 | mParameters = mCamera.getParameters();
21 | }
22 | }
23 |
24 | @Override
25 | public void destroy() {
26 | if (mCamera != null) {
27 | mCamera.release();
28 | mCamera = null;
29 | System.gc();
30 | }
31 | }
32 |
33 | @Override
34 | public boolean toggleTorch() {
35 | init();
36 | boolean flashOnBefore = mParameters.getFlashMode().equals(Camera.Parameters.FLASH_MODE_TORCH);
37 | if (flashOnBefore) {
38 | disableTorch();
39 | return false;
40 | } else {
41 | torch();
42 | return true;
43 | }
44 | }
45 |
46 | @Override
47 | public void torch() {
48 | if (mCamera != null && mParameters != null) {
49 | if (!mParameters.getFlashMode().equals(Camera.Parameters.FLASH_MODE_TORCH)) {
50 | mParameters.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);
51 | mCamera.setParameters(mParameters);
52 | if (Build.VERSION.SDK_INT >= 22) {
53 | SurfaceTexture mPreviewTexture = new SurfaceTexture(0);
54 | try {
55 | mCamera.setPreviewTexture(mPreviewTexture); // Fix G4 torch support
56 | } catch (IOException ex) {
57 | // Ignore
58 | }
59 | }
60 | mCamera.startPreview();
61 | setTorchOn(true);
62 | }
63 | }
64 | }
65 |
66 | @Override
67 | public void disableTorch() {
68 | if (mCamera != null && mParameters != null) {
69 | mParameters.setFlashMode(Camera.Parameters.FLASH_MODE_OFF);
70 | mCamera.setParameters(mParameters);
71 | mCamera.stopPreview();
72 | setTorchOn(false);
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/torch/NotificationReceiver.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.torch
2 |
3 | import android.content.BroadcastReceiver
4 | import android.content.Context
5 | import android.content.Intent
6 |
7 | /**
8 | * Receive `com.yoavst.notificationtorch` broadcast and disables the torch and frees the camera.
9 | */
10 | public class NotificationReceiver : BroadcastReceiver() {
11 |
12 | override fun onReceive(context: Context, intent: Intent) {
13 | // Turn on the torch and disable all
14 | CameraManager.disableTorch()
15 | CameraManager.destroy()
16 | }
17 |
18 | companion object {
19 | public val NOTIFICATION_ID: Int = 1423
20 | }
21 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/torch/PhoneActivityNotFloating.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.torch
2 |
3 | import android.app.Activity
4 | import android.app.NotificationManager
5 | import android.content.Intent
6 | import android.content.IntentFilter
7 | import android.os.Bundle
8 | import com.yoavst.kotlin.broadcastReceiver
9 | import com.yoavst.kotlin.systemService
10 | import com.yoavst.quickapps.R
11 | import kotlinx.android.synthetic.torch_activity.offIcon
12 | import kotlinx.android.synthetic.torch_activity.offIconAnimation
13 | import kotlinx.android.synthetic.torch_activity.offLayout
14 | import kotlinx.android.synthetic.torch_activity.onLayout
15 | import kotlin.properties.Delegates
16 |
17 | /**
18 | * The regular torch activity.
19 | */
20 | public class PhoneActivityNotFloating : Activity() {
21 | val notificationManager: NotificationManager by systemService()
22 | val delegation: TorchDelegate by Delegates.lazy { TorchDelegate(this, offIcon, offIconAnimation, offLayout, onLayout) }
23 | var isDestroyForQCircle = false
24 | val receiver = broadcastReceiver { context, intent ->
25 | isDestroyForQCircle = true
26 | finish()
27 | }
28 |
29 | override fun onCreate(savedInstanceState: Bundle?) {
30 | super.onCreate(savedInstanceState)
31 | setContentView(R.layout.torch_activity)
32 | delegation.init()
33 | }
34 |
35 | override fun onDestroy() {
36 | super.onDestroy()
37 | if (!isDestroyForQCircle)
38 | CameraManager.destroy()
39 | unregisterReceiver(receiver)
40 | }
41 |
42 | override fun onBackPressed() {
43 | val startMain = Intent(Intent.ACTION_MAIN)
44 | startMain.addCategory(Intent.CATEGORY_HOME)
45 | startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
46 | startActivity(startMain)
47 | }
48 |
49 | override fun onPause() {
50 | super.onPause()
51 | if (CameraManager.isTorchOn())
52 | notificationManager.notify(NotificationReceiver.NOTIFICATION_ID, Torch.notification)
53 | else if (!isDestroyForQCircle)
54 | CameraManager.destroy()
55 | }
56 |
57 | override fun onResume() {
58 | super.onResume()
59 | CameraManager(this)
60 | CameraManager.init()
61 | Torch(this)
62 | notificationManager.cancel(NotificationReceiver.NOTIFICATION_ID)
63 | delegation.showCurrentMode()
64 | registerReceiver(receiver, IntentFilter(Torch.killAllInstances))
65 | }
66 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/torch/Torch.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.torch
2 |
3 | import android.app.Notification
4 | import android.app.PendingIntent
5 | import android.content.Context
6 | import android.content.Intent
7 | import com.yoavst.quickapps.R
8 |
9 | /**
10 | * Helper class for notification creating. Needed to be initialized in order to work, using `Torch(context)`.
11 | */
12 | public object Torch {
13 | public var notification: Notification? = null
14 | public val killAllInstances: String = "com.yoavst.torch.killAll"
15 | public fun invoke(context: Context) {
16 | if (notification == null) {
17 | val intent = Intent("com.yoavst.notificationtorch")
18 | val pIntent = PendingIntent.getBroadcast(context, 0, intent, 0)
19 | notification = Notification.Builder(context)
20 | .setContentTitle(context.getString(R.string.torch_is_on))
21 | .setContentText(context.getString(R.string.touch_to_turn_off))
22 | .setSmallIcon(R.drawable.ic_noti_torch)
23 | .setAutoCancel(true)
24 | .setContentIntent(pIntent)
25 | .build()
26 | notification!!.flags = notification!!.flags or Notification.FLAG_ONGOING_EVENT
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/torch/TorchReceiver.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.torch
2 |
3 | import android.app.NotificationManager
4 | import android.content.BroadcastReceiver
5 | import android.content.Context
6 | import android.content.Intent
7 | import com.yoavst.kotlin.notificationManager
8 |
9 | /**
10 | * Receive `com.yoavst.toggletorch` broadcast and toggle the torch. It also responsible for showing/hiding the notification.
11 | */
12 | public class TorchReceiver : BroadcastReceiver() {
13 | var mNotificationManager: NotificationManager? = null
14 |
15 | override fun onReceive(context: Context, intent: Intent) {
16 | CameraManager(context)
17 | if (mNotificationManager == null)
18 | mNotificationManager = context.notificationManager()
19 | Torch(context)
20 | if (CameraManager.toggleTorch()) {
21 | mNotificationManager!!.notify(NotificationReceiver.NOTIFICATION_ID, Torch.notification)
22 | } else {
23 | mNotificationManager!!.cancel(NotificationReceiver.NOTIFICATION_ID)
24 | CameraManager.destroy()
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/yoavst/quickapps/torch/WidgetProvider.kt:
--------------------------------------------------------------------------------
1 | package com.yoavst.quickapps.torch
2 |
3 | import android.app.PendingIntent
4 | import android.appwidget.AppWidgetManager
5 | import android.appwidget.AppWidgetProvider
6 | import android.content.ComponentName
7 | import android.content.Context
8 | import android.content.Intent
9 | import android.widget.RemoteViews
10 | import com.yoavst.quickapps.R
11 | import com.yoavst.quickapps.tools.torchShowOldIcon
12 |
13 | /**
14 | * Responsible on the torch widget. on every click on the widget, it broadcast `com.yoavst.toggletorch` which toggles the torch.
15 | */
16 | public class WidgetProvider : AppWidgetProvider() {
17 |
18 | override fun onUpdate(context: Context, appWidgetManager: AppWidgetManager, appWidgetIds: IntArray) {
19 | super.onUpdate(context, appWidgetManager, appWidgetIds)
20 | val myWidget = ComponentName(context, javaClass())
21 | val updateViews = RemoteViews(context.getPackageName(), R.layout.torch_widget)
22 | updateViews.setImageViewResource(R.id.widget,
23 | if (context.torchShowOldIcon) R.drawable.old_qcircle_icon_torch else R.drawable.qcircle_icon_torch)
24 | val intent = Intent("com.yoavst.toggletorch")
25 | intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES)
26 | val pendingIntent = PendingIntent.getBroadcast(context, 0, intent, 0)
27 | // Create an Intent to launch Browser
28 | updateViews.setOnClickPendingIntent(R.id.widget, pendingIntent)
29 | appWidgetManager.updateAppWidget(myWidget, updateViews)
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/circle_expand_toggle.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
16 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/circle_expand_torch.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
16 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/circle_path_toggle.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/circle_path_torch.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_advanced_btn_functions_cos.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_advanced_btn_functions_cos.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_advanced_btn_functions_cos1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_advanced_btn_functions_cos1.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_advanced_btn_functions_log.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_advanced_btn_functions_log.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_advanced_btn_functions_sin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_advanced_btn_functions_sin.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_advanced_btn_functions_sin1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_advanced_btn_functions_sin1.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_advanced_btn_functions_tan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_advanced_btn_functions_tan.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_advanced_btn_functions_tan1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_advanced_btn_functions_tan1.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_advanced_btn_functions_xy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_advanced_btn_functions_xy.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_advanced_btn_operators_ans.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_advanced_btn_operators_ans.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_advanced_btn_operators_pi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_advanced_btn_operators_pi.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_basic_btn_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_basic_btn_delete.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_basic_btn_delete_ac.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_basic_btn_delete_ac.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_basic_btn_equal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_basic_btn_equal.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_basic_btn_number_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_basic_btn_number_0.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_basic_btn_number_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_basic_btn_number_1.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_basic_btn_number_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_basic_btn_number_2.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_basic_btn_number_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_basic_btn_number_3.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_basic_btn_number_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_basic_btn_number_4.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_basic_btn_number_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_basic_btn_number_5.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_basic_btn_number_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_basic_btn_number_6.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_basic_btn_number_7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_basic_btn_number_7.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_basic_btn_number_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_basic_btn_number_8.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_basic_btn_number_9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_basic_btn_number_9.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_basic_btn_number_dot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_basic_btn_number_dot.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_basic_btn_operators_bracket.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_basic_btn_operators_bracket.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_basic_btn_operators_division.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_basic_btn_operators_division.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_basic_btn_operators_multiply.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_basic_btn_operators_multiply.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_basic_btn_operators_plus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_basic_btn_operators_plus.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_basic_btn_operators_root.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_basic_btn_operators_root.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_basic_btn_operators_subtraction.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_basic_btn_operators_subtraction.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-640dpi/calculator_basic_btn_operators_x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-640dpi/calculator_basic_btn_operators_x.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/circle_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/circle_background.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/d1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/d1.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/d2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/d2.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/d3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/d3.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/d4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/d4.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/d5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/d5.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/d6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/d6.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/game_over.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/game_over.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/old_qcircle_icon_calculator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/old_qcircle_icon_calculator.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/old_qcircle_icon_calendar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/old_qcircle_icon_calendar.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/old_qcircle_icon_clock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/old_qcircle_icon_clock.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/old_qcircle_icon_compass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/old_qcircle_icon_compass.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/old_qcircle_icon_music.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/old_qcircle_icon_music.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/old_qcircle_icon_recorder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/old_qcircle_icon_recorder.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/old_qcircle_icon_toggles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/old_qcircle_icon_toggles.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/old_qcircle_icon_torch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/old_qcircle_icon_torch.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/preview.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/qcircle_icon_ball.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/qcircle_icon_ball.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/qcircle_icon_barcode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/qcircle_icon_barcode.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/qcircle_icon_calculator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/qcircle_icon_calculator.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/qcircle_icon_calendar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/qcircle_icon_calendar.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/qcircle_icon_clock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/qcircle_icon_clock.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/qcircle_icon_compass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/qcircle_icon_compass.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/qcircle_icon_dialer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/qcircle_icon_dialer.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/qcircle_icon_dice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/qcircle_icon_dice.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/qcircle_icon_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/qcircle_icon_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/qcircle_icon_music.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/qcircle_icon_music.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/qcircle_icon_news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/qcircle_icon_news.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/qcircle_icon_notifications.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/qcircle_icon_notifications.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/qcircle_icon_recorder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/qcircle_icon_recorder.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/qcircle_icon_simon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/qcircle_icon_simon.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/qcircle_icon_toggles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/qcircle_icon_toggles.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/qcircle_icon_torch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-nodpi/qcircle_icon_torch.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/dialer_btn_back.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/dialer_btn_call.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/dialer_btn_delete.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/dialer_btn_digit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/stopwatch_btn_pause.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/stopwatch_btn_start.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/stopwatch_btn_stop.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_drawer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-xhdpi/ic_drawer.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_noti_torch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-xhdpi/ic_noti_torch.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_drawer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-xxhdpi/ic_drawer.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_noti_torch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-xxhdpi/ic_noti_torch.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/compass_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-xxxhdpi/compass_back.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/compass_needle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable-xxxhdpi/compass_needle.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/animated_bluetooth.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/animated_power.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/calculator_btn_ac.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 | -
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/calculator_btn_ac_inset.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/calculator_btn_delete.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 | -
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/calculator_btn_delete_inset.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/calculator_btn_equal.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 | -
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/calculator_btn_equal_inset.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/calculator_btn_function.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 | -
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/calculator_btn_function_inset.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/calculator_btn_regular.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 | -
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/calculator_btn_regular_inset.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/dialer_btn_back.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
9 |
10 |
11 | -
12 |
13 |
14 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/dialer_btn_call.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
9 |
10 |
11 | -
12 |
13 |
14 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/dialer_btn_delete.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
9 |
10 |
11 | -
12 |
13 |
14 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/dialer_btn_digit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
9 |
10 |
11 | -
12 |
13 |
14 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/drag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable/drag.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_add.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_back.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_bluetooth.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
20 |
21 |
26 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_brightness.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_brightness_auto.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_brightness_high.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_brightness_low.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_brightness_medium.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_call.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_delete.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_done.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_pause.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_play.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_power.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
12 |
13 |
16 |
21 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_refresh.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_remove.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_skip_next.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_skip_prev.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
9 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_sound.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_vibrate.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_volume.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_wifi.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
17 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_wifi_tethering.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_wifi_tethering_off.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_torch.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
18 |
22 |
25 |
30 |
35 |
36 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/notification_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/notification_delete.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | -
5 |
6 |
7 |
8 |
9 | -
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/quickcircle_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/drawable/quickcircle_settings.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shape_oval.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/stopwatch_btn_pause.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/stopwatch_btn_pause_normal.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/stopwatch_btn_start.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/stopwatch_btn_start_normal.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/stopwatch_btn_stop.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/stopwatch_btn_stop_normal.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/toggle_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout-v21/torch_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
17 |
18 |
24 |
25 |
32 |
33 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/calculator_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
27 |
28 |
44 |
45 |
50 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/calendar_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
20 |
21 |
22 |
30 |
31 |
41 |
42 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/clock_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
17 |
18 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/clock_qslide_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
25 |
26 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/compass_activity.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/compass_qslide_activity.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
17 |
18 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/deskop_launcher_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
19 |
20 |
27 |
28 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/desktop_activity_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/desktop_fragment_source.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
16 |
17 |
25 |
26 |
27 |
31 |
32 |
33 |
34 |
41 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/desktop_toggle_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/desktop_view_line.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
18 |
19 |
23 |
24 |
30 |
31 |
37 |
38 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/desktop_view_line_color.xml:
--------------------------------------------------------------------------------
1 |
14 |
15 |
20 |
21 |
27 |
28 |
34 |
35 |
36 |
43 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/desktop_view_module.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
14 |
15 |
21 |
22 |
27 |
28 |
36 |
37 |
38 |
43 |
44 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialer_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/launcher_horizontal_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/launcher_vertical_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
13 |
14 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/music_old_buttons.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
25 |
26 |
36 |
37 |
47 |
48 |
49 |
54 |
55 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/qcircle_empty.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
17 |
18 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/recorder_activity.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
24 |
25 |
32 |
33 |
43 |
44 |
54 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/torch_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
16 |
17 |
24 |
25 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/torch_widget.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/watchface_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
23 |
24 |
35 |
36 |
45 |
46 |
47 |
59 |
60 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/drawer.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/raw/a.m4a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/raw/a.m4a
--------------------------------------------------------------------------------
/app/src/main/res/raw/b.m4a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/raw/b.m4a
--------------------------------------------------------------------------------
/app/src/main/res/raw/c.m4a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/raw/c.m4a
--------------------------------------------------------------------------------
/app/src/main/res/raw/d.m4a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/app/src/main/res/raw/d.m4a
--------------------------------------------------------------------------------
/app/src/main/res/values-v21/bools.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | false
4 | true
5 |
--------------------------------------------------------------------------------
/app/src/main/res/values-xxxhdpi/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 30dp
4 | 45dp
5 | 25dp
6 | 35sp
7 | 18sp
8 | 40dp
9 | 65dp
10 | 15dp
11 | 19dp
12 | @dimen/small_item
13 | @dimen/small_item
14 | @dimen/title
15 | 16dp
16 | 55dp
17 | 1dp
18 | @dimen/title
19 | 15sp
20 | @dimen/small_item
21 | 0dp
22 | 16dp
23 | 16dp
24 | @dimen/small_item
25 | @dimen/title
26 | @dimen/small_item
27 |
--------------------------------------------------------------------------------
/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/bools.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 | false
5 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3f51b5
4 | #303f9f
5 | #ff4081
6 |
7 | #4dffffff
8 | #1f000000
9 |
10 |
11 | #1D1D1D
12 | @android:color/white
13 | @android:color/white
14 |
15 |
16 | #0BE5D5
17 | #F1561E
18 |
19 |
20 | @color/md_deep_purple_500
21 | @color/md_deep_purple_700
22 | @color/md_blue_grey_500
23 | @color/md_blue_grey_700
24 | @color/md_deep_orange_500
25 | @color/md_deep_orange_700
26 | @color/md_teal_500
27 | @color/md_teal_700
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/values/integers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 750
4 |
5 | 500
6 | 1250
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
13 |
14 |
20 |
21 |
27 |
28 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/device_admin_permissions.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/digital_clock_watchface.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/torch_widget_provider.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.2.3'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | flatDir {
19 | dirs 'libs'
20 | }
21 | maven {
22 | url "https://jitpack.io"
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun Jun 21 11:37:46 IDT 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
7 |
--------------------------------------------------------------------------------
/images/barcode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/images/barcode.png
--------------------------------------------------------------------------------
/images/calculator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/images/calculator.png
--------------------------------------------------------------------------------
/images/calendar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/images/calendar.png
--------------------------------------------------------------------------------
/images/clock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/images/clock.png
--------------------------------------------------------------------------------
/images/compass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/images/compass.png
--------------------------------------------------------------------------------
/images/dice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/images/dice.png
--------------------------------------------------------------------------------
/images/magic8ball.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/images/magic8ball.png
--------------------------------------------------------------------------------
/images/music.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/images/music.png
--------------------------------------------------------------------------------
/images/news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/images/news.png
--------------------------------------------------------------------------------
/images/notifications.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/images/notifications.png
--------------------------------------------------------------------------------
/images/phone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/images/phone.png
--------------------------------------------------------------------------------
/images/recorder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/images/recorder.png
--------------------------------------------------------------------------------
/images/simon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/images/simon.png
--------------------------------------------------------------------------------
/images/toggles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/images/toggles.png
--------------------------------------------------------------------------------
/images/torch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yoavst/quickapps/8b7fe52844a0bcc29c6288044322fe04e890c028/images/torch.png
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------