├── .gitignore ├── LICENSE.md ├── README.md ├── app ├── QS.xcf ├── build.gradle ├── feature.jpg ├── google-services.json ├── icon.png ├── libs │ ├── sdk-v1.0.0.jar │ └── slook_v1.4.0.jar ├── pill_div.svg ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── aidl │ └── com │ │ └── xda │ │ └── nobar │ │ ├── IActionSelectedCallback.aidl │ │ ├── IActionsBinder.aidl │ │ ├── RootActions.aidl │ │ └── adapters │ │ └── info │ │ └── ActionInfo.aidl │ ├── ic_launcher-web.png │ ├── java │ └── com │ │ └── xda │ │ └── nobar │ │ ├── App.kt │ │ ├── activities │ │ ├── MainActivity.kt │ │ ├── TaskerConfig.kt │ │ ├── ToggleGesturesActivity.kt │ │ ├── ToggleNavActivity.kt │ │ ├── helpers │ │ │ ├── DialogActivity.kt │ │ │ ├── RequestPermissionsActivity.kt │ │ │ └── ScreenshotActivity.kt │ │ ├── selectors │ │ │ ├── ActionSelectorActivity.kt │ │ │ ├── ActivityLaunchSelectActivity.kt │ │ │ ├── AppColorSettingsActivity.kt │ │ │ ├── AppLaunchSelectActivity.kt │ │ │ ├── BaseAppSelectActivity.kt │ │ │ ├── BlacklistSelectorActivity.kt │ │ │ ├── IntentSelectorActivity.kt │ │ │ └── ShortcutSelectActivity.kt │ │ └── ui │ │ │ ├── AppDrawerActivity.kt │ │ │ ├── CrashActivity.kt │ │ │ ├── HelpAboutActivity.kt │ │ │ ├── IntroActivity.kt │ │ │ ├── LibraryActivity.kt │ │ │ ├── SettingsActivity.kt │ │ │ ├── SettingsSearchActivity.kt │ │ │ └── TroubleshootingActivity.kt │ │ ├── adapters │ │ ├── ActionSelectAdapter.kt │ │ ├── AppSelectAdapter.kt │ │ ├── BaseSelectAdapter.kt │ │ ├── IntentSelectorAdapter.kt │ │ ├── ShortcutSelectAdapter.kt │ │ └── info │ │ │ ├── ActionInfo.kt │ │ │ ├── ActionInfoSorterCallback.kt │ │ │ ├── AppInfo.kt │ │ │ ├── AppInfoSorterCallback.kt │ │ │ ├── IntentInfo.kt │ │ │ ├── IntentInfoSorterCallback.kt │ │ │ ├── ShortcutInfo.kt │ │ │ └── ShortcutInfoSorterCallback.kt │ │ ├── data │ │ ├── ColoredAppData.kt │ │ └── SettingsIndex.kt │ │ ├── dev │ │ ├── PreferenceViewerActivity.kt │ │ └── PreferenceViewerAdapter.kt │ │ ├── fragments │ │ ├── intro │ │ │ ├── DynamicForwardFragmentSlide.kt │ │ │ ├── DynamicForwardSlide.kt │ │ │ ├── WelcomeFragment.kt │ │ │ └── WriteSecureFragment.kt │ │ ├── main │ │ │ └── HomeFragment.kt │ │ ├── settings │ │ │ ├── BackupRestoreFragment.kt │ │ │ ├── BasePrefFragment.kt │ │ │ ├── BehaviorFragment.kt │ │ │ ├── CompatibilityFragment.kt │ │ │ ├── ExperimentalFragment.kt │ │ │ ├── HelpFragment.kt │ │ │ ├── LibraryPrefs.kt │ │ │ ├── MainFragment.kt │ │ │ ├── appearance │ │ │ │ ├── AppearanceFragment.kt │ │ │ │ ├── PillAppearanceFragment.kt │ │ │ │ └── SideAppearanceFragment.kt │ │ │ ├── gestures │ │ │ │ ├── GestureFragment.kt │ │ │ │ ├── PillGestureFragment.kt │ │ │ │ └── SideGestureFragment.kt │ │ │ └── search │ │ │ │ └── SearchFragment.kt │ │ └── troubleshooting │ │ │ └── TroubleshootingFragment.kt │ │ ├── interfaces │ │ ├── OnAppSelectedListener.java │ │ ├── OnDialogChoiceMadeListener.java │ │ ├── OnGestureStateChangeListener.java │ │ ├── OnIntentSelectedListener.java │ │ ├── OnItemChosenListener.java │ │ ├── OnLicenseCheckResultListener.java │ │ ├── OnNavBarHideStateChangeListener.java │ │ ├── OnProgressSetListener.java │ │ ├── OnShortcutSelectedListener.java │ │ └── ReceiverCallback.kt │ │ ├── prefs │ │ ├── NavControllerPreference.kt │ │ ├── PixelDPSwitch.kt │ │ ├── RedTextWarningPref.kt │ │ ├── SectionableListPreference.kt │ │ └── SeekBarSwitchPreference.kt │ │ ├── providers │ │ ├── BaseProvider.kt │ │ ├── CocktailProvider.kt │ │ ├── HomeScreenProviderHoriz.kt │ │ ├── HomeScreenProviderVert.kt │ │ └── SignBoardProvider.kt │ │ ├── receivers │ │ ├── ActionReceiver.kt │ │ └── StartupReceiver.kt │ │ ├── root │ │ ├── RootHandler.kt │ │ ├── RootWrapper.kt │ │ └── ScreenshotHelper.kt │ │ ├── services │ │ ├── Actions.kt │ │ └── KeepAliveService.kt │ │ ├── tasker │ │ ├── activities │ │ │ ├── BaseNoInputOutputActivity.kt │ │ │ ├── EventConfigureActivity.kt │ │ │ ├── ToggleGestureActivity.kt │ │ │ └── ToggleNavActivity.kt │ │ ├── inputs │ │ │ └── EventInput.kt │ │ ├── runners │ │ │ ├── EventRunner.kt │ │ │ ├── ToggleGestureRunner.kt │ │ │ └── ToggleNavRunner.kt │ │ └── updates │ │ │ └── EventUpdate.kt │ │ ├── tiles │ │ ├── GestureToggle.kt │ │ └── NavBarToggle.kt │ │ ├── util │ │ ├── BarAnimator.kt │ │ ├── CrashHandler.kt │ │ ├── IImersiveHelperManager.kt │ │ ├── IWindowManager.kt │ │ ├── LogicHandler.kt │ │ ├── PrefManager.kt │ │ ├── ProxyUtil.kt │ │ ├── Utils.kt │ │ ├── backup │ │ │ ├── AppearanceBackupRestoreManager.kt │ │ │ ├── BaseBackupRestoreManager.kt │ │ │ ├── BehaviorBackupRestoreManager.kt │ │ │ ├── GestureBackupRestoreManager.kt │ │ │ └── OmniBackupRestoreManager.kt │ │ ├── flashlight │ │ │ ├── FlashlightControllerBase.kt │ │ │ ├── FlashlightControllerLollipop.kt │ │ │ └── FlashlightControllerMarshmallow.kt │ │ └── helpers │ │ │ ├── DisabledReasonManager.kt │ │ │ ├── GsonHandlers.kt │ │ │ ├── HiddenPillReasonManagerNew.kt │ │ │ ├── ImmersiveHelperManager.kt │ │ │ ├── IntroSlideHolder.kt │ │ │ ├── PremiumHelper.kt │ │ │ ├── ScreenOffHelper.kt │ │ │ ├── SideSwipeGestureManager.kt │ │ │ └── bar │ │ │ ├── ActionHolder.kt │ │ │ ├── ActionManager.kt │ │ │ ├── BarViewActionHandler.kt │ │ │ └── NewBarViewGestureManager.kt │ │ └── views │ │ ├── BarView.kt │ │ ├── ImmersiveHelperView.kt │ │ ├── NavBlackout.kt │ │ ├── SideSwipeView.kt │ │ └── TextSwitch.kt │ └── res │ ├── drawable-v26 │ ├── ic_shortcut_gesture.xml │ ├── ic_shortcut_nav.xml │ └── ic_shortcut_settings.xml │ ├── drawable │ ├── anchor_white.xml │ ├── animation.xml │ ├── arrow_down.xml │ ├── arrow_up.xml │ ├── autorenew.xml │ ├── backup.xml │ ├── blank.xml │ ├── border_bottom.xml │ ├── border_clear.xml │ ├── border_clear_108.xml │ ├── car.xml │ ├── circle.xml │ ├── circle_small.xml │ ├── color_circle.xml │ ├── color_lens.xml │ ├── done.xml │ ├── double_tap.xml │ ├── edge_line.xml │ ├── expand_horizontal.xml │ ├── expand_vertical.xml │ ├── fullscreen.xml │ ├── gesture.xml │ ├── gesture_accent_108.xml │ ├── gesture_outline.xml │ ├── hearing.xml │ ├── ic_add_black_24dp.xml │ ├── ic_bug_report.xml │ ├── ic_complex_down_left.xml │ ├── ic_complex_down_left_long.xml │ ├── ic_complex_down_right.xml │ ├── ic_complex_down_right_long.xml │ ├── ic_complex_up_left.xml │ ├── ic_complex_up_left_long.xml │ ├── ic_complex_up_right.xml │ ├── ic_complex_up_right_long.xml │ ├── ic_delete_white_24dp.xml │ ├── ic_gradient.xml │ ├── ic_launcher_foreground.xml │ ├── ic_layers_white_24dp.xml │ ├── ic_navgest.xml │ ├── ic_opacity.xml │ ├── ic_repeat_24dp.xml │ ├── ic_search_24dp.xml │ ├── ic_shortcut_gesture.xml │ ├── ic_shortcut_nav.xml │ ├── ic_shortcut_settings.xml │ ├── ic_transition.xml │ ├── ic_vibration.xml │ ├── info.xml │ ├── keyboard.xml │ ├── keyboard_hide.xml │ ├── nav_acc.png │ ├── nav_overlay.png │ ├── palette_white.xml │ ├── pill_div.xml │ ├── pill_drawable.xml │ ├── pill_tap_flash.xml │ ├── pill_tap_ripple.xml │ ├── qs.png │ ├── refresh.xml │ ├── reset.xml │ ├── restore.xml │ ├── rounded_corner.xml │ ├── screen_rotation.xml │ ├── settings.xml │ ├── settings_accent_108.xml │ ├── shadow.xml │ ├── storage.xml │ ├── swap_horizontal.xml │ ├── swap_vertical.xml │ ├── swipe_down.xml │ ├── swipe_left.xml │ ├── swipe_right.xml │ ├── swipe_up.xml │ ├── swipe_up_hold.xml │ ├── tap.xml │ ├── tap_hold.xml │ ├── test_tube.xml │ ├── visibility_off.xml │ ├── warning.xml │ └── widget_background.xml │ ├── layout │ ├── action_pref.xml │ ├── activity_app_color_settings.xml │ ├── activity_app_launch_select.xml │ ├── activity_blank.xml │ ├── activity_crash.xml │ ├── activity_help.xml │ ├── activity_library.xml │ ├── activity_main.xml │ ├── activity_preference_viewer.xml │ ├── activity_search.xml │ ├── activity_settings.xml │ ├── activity_troubleshooting.xml │ ├── app_info_multi.xml │ ├── app_info_single.xml │ ├── colored_app_item.xml │ ├── help_button.xml │ ├── layout_main_activity.xml │ ├── pill.xml │ ├── pref_category.xml │ ├── preference_view_layout.xml │ ├── settings_button.xml │ ├── slide_welcome.xml │ ├── text_input.xml │ ├── text_switch.xml │ ├── use_recommended_settings_dialog_message_view.xml │ ├── widget_layout.xml │ ├── widget_layout_horiz.xml │ ├── widget_layout_signboard.xml │ ├── widget_layout_vertical.xml │ └── zero_height_pref.xml │ ├── menu │ ├── menu_launch_search.xml │ └── menu_search.xml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ ├── ic_launcher_background.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ ├── ic_launcher_background.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ ├── ic_launcher_background.png │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ ├── ic_launcher_background.png │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ ├── ic_launcher_background.png │ └── ic_launcher_round.png │ ├── navigation │ ├── main_graph.xml │ ├── search_graph.xml │ ├── settings_graph.xml │ └── troubleshooting_graph.xml │ ├── raw │ ├── hide_nav.mp4 │ └── nav_gesture.mp4 │ ├── values │ ├── actions.xml │ ├── arrays.xml │ ├── attrs.xml │ ├── bools.xml │ ├── colors.xml │ ├── dimens.xml │ ├── integers.xml │ ├── strings.xml │ └── styles.xml │ └── xml │ ├── actions.xml │ ├── backup_rules.xml │ ├── cocktail.xml │ ├── prefs_about.xml │ ├── prefs_appearance.xml │ ├── prefs_backup_restore.xml │ ├── prefs_behavior.xml │ ├── prefs_compatibility.xml │ ├── prefs_experimental.xml │ ├── prefs_gestures.xml │ ├── prefs_lib.xml │ ├── prefs_main.xml │ ├── prefs_pill_appearance.xml │ ├── prefs_pill_gestures.xml │ ├── prefs_search.xml │ ├── prefs_side_appearance.xml │ ├── prefs_side_gestures.xml │ ├── prefs_troubleshooting.xml │ ├── shortcuts.xml │ ├── signboard.xml │ ├── widget.xml │ └── widget_vertical.xml ├── build.gradle ├── crowdin.yml ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/libraries 5 | /.idea/modules.xml 6 | /.idea/workspace.xml 7 | .DS_Store 8 | /build 9 | /captures 10 | .externalNativeBuild 11 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (C) 2019 XDA Developers 2 | 3 | This program is free software: you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation, either version 3 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program. If not, see . 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | XDA Nobar / Navigation Gestures 2 | ======== 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/QS.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/QS.xcf -------------------------------------------------------------------------------- /app/feature.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/feature.jpg -------------------------------------------------------------------------------- /app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "708143549153", 4 | "firebase_url": "https://nobar-21e7f.firebaseio.com", 5 | "project_id": "nobar-21e7f", 6 | "storage_bucket": "nobar-21e7f.appspot.com" 7 | }, 8 | "client": [ 9 | { 10 | "client_info": { 11 | "mobilesdk_app_id": "1:708143549153:android:39ef725cfff5bf87", 12 | "android_client_info": { 13 | "package_name": "com.xda.nobar" 14 | } 15 | }, 16 | "oauth_client": [ 17 | { 18 | "client_id": "708143549153-19rg0a0tac4cspujr398gcfu5fq3fjts.apps.googleusercontent.com", 19 | "client_type": 3 20 | } 21 | ], 22 | "api_key": [ 23 | { 24 | "current_key": "AIzaSyDyT9CjbiZ44g7jbfzGIMW7aUIdZeqGL4k" 25 | } 26 | ], 27 | "services": { 28 | "analytics_service": { 29 | "status": 1 30 | }, 31 | "appinvite_service": { 32 | "status": 1, 33 | "other_platform_oauth_client": [] 34 | }, 35 | "ads_service": { 36 | "status": 2 37 | } 38 | } 39 | } 40 | ], 41 | "configuration_version": "1" 42 | } -------------------------------------------------------------------------------- /app/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/icon.png -------------------------------------------------------------------------------- /app/libs/sdk-v1.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/libs/sdk-v1.0.0.jar -------------------------------------------------------------------------------- /app/libs/slook_v1.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/libs/slook_v1.4.0.jar -------------------------------------------------------------------------------- /app/pill_div.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 10 | 30 | 32 | 33 | 35 | image/svg+xml 36 | 38 | 39 | 40 | 41 | 42 | 46 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | 23 | -keep class com.google.android.gms.measurement.AppMeasurement { *; } 24 | -keep class com.google.android.gms.measurement.AppMeasurement$OnEventListener { *; } 25 | -dontwarn com.google.android.gms.measurement.** 26 | 27 | -dontobfuscate 28 | 29 | -keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {} 30 | -keepnames class kotlinx.coroutines.CoroutineExceptionHandler {} 31 | -keepclassmembernames class kotlinx.** { 32 | volatile ; 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/aidl/com/xda/nobar/IActionSelectedCallback.aidl: -------------------------------------------------------------------------------- 1 | package com.xda.nobar; 2 | 3 | import com.xda.nobar.adapters.info.ActionInfo; 4 | 5 | interface IActionSelectedCallback { 6 | void onActionInfoSelected(in ActionInfo info); 7 | } -------------------------------------------------------------------------------- /app/src/main/aidl/com/xda/nobar/IActionsBinder.aidl: -------------------------------------------------------------------------------- 1 | package com.xda.nobar; 2 | 3 | interface IActionsBinder { 4 | void addBar(); 5 | void addBlackout(); 6 | void remBar(); 7 | void remBlackout(); 8 | void addImmersiveHelper(); 9 | void removeImmersiveHelper(); 10 | void sendAction(int action); 11 | void addBarAndBlackout(); 12 | void remBarAndBlackout(); 13 | void addLeftSide(); 14 | void addRightSide(); 15 | void remLeftSide(); 16 | void remRightSide(); 17 | void setBlackoutGone(boolean gone); 18 | } -------------------------------------------------------------------------------- /app/src/main/aidl/com/xda/nobar/RootActions.aidl: -------------------------------------------------------------------------------- 1 | package com.xda.nobar; 2 | 3 | import java.lang.String; 4 | 5 | interface RootActions { 6 | void sendKeyEvent(int code); 7 | void sendLongKeyEvent(int code); 8 | void sendDoubleKeyEvent(int code); 9 | void lockScreen(); 10 | void screenshot(); 11 | void killCurrentApp(); 12 | void notifyAccessibilityButtonClicked(); 13 | void launchAccessibilityButtonChooser(); 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/aidl/com/xda/nobar/adapters/info/ActionInfo.aidl: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.adapters.info; 2 | 3 | parcelable ActionInfo; -------------------------------------------------------------------------------- /app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/activities/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.activities 2 | 3 | import android.animation.LayoutTransition 4 | import android.content.Context 5 | import android.content.Intent 6 | import android.os.Bundle 7 | import android.view.LayoutInflater 8 | import androidx.appcompat.app.AppCompatActivity 9 | import androidx.navigation.NavController 10 | import androidx.navigation.findNavController 11 | import com.xda.nobar.R 12 | import com.xda.nobar.activities.ui.IntroActivity 13 | import kotlinx.android.synthetic.main.activity_main.* 14 | 15 | /** 16 | * The main app activity 17 | */ 18 | class MainActivity : AppCompatActivity() { 19 | companion object { 20 | fun start(context: Context) { 21 | context.startActivity(makeIntent(context)) 22 | } 23 | 24 | fun makeIntent(context: Context): Intent { 25 | val launch = Intent(context, MainActivity::class.java) 26 | launch.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT or Intent.FLAG_ACTIVITY_NEW_TASK) 27 | return launch 28 | } 29 | } 30 | 31 | private val navController: NavController 32 | get() = findNavController(R.id.main_host) 33 | 34 | override fun onCreate(savedInstanceState: Bundle?) { 35 | super.onCreate(savedInstanceState) 36 | 37 | IntroActivity.needsToRunAsync(this) { 38 | if (it) IntroActivity.start(this) 39 | } 40 | 41 | setContentView(R.layout.activity_main) 42 | 43 | root.layoutTransition.enableTransitionType(LayoutTransition.CHANGING) 44 | 45 | setUpActionBar() 46 | } 47 | 48 | /** 49 | * Add buttons to the action bar 50 | */ 51 | private fun setUpActionBar() { 52 | setSupportActionBar(toolbar) 53 | 54 | val gear = LayoutInflater.from(this).inflate(R.layout.settings_button, toolbar, false) 55 | gear.setOnClickListener { navController.navigate(R.id.action_homeFragment_to_settingsActivity2) } 56 | 57 | val about = LayoutInflater.from(this).inflate(R.layout.help_button, toolbar, false) 58 | about.setOnClickListener { navController.navigate(R.id.action_homeFragment_to_helpAboutActivity) } 59 | 60 | toolbar.addView(gear) 61 | toolbar.addView(about) 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/activities/TaskerConfig.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.activities 2 | 3 | import android.content.Context 4 | import androidx.appcompat.app.AppCompatActivity 5 | import com.joaomgcd.taskerpluginlibrary.config.TaskerPluginConfig 6 | import com.joaomgcd.taskerpluginlibrary.input.TaskerInput 7 | 8 | /** 9 | * WIP 10 | */ 11 | open class TaskerConfig : AppCompatActivity(), TaskerPluginConfig { 12 | override val context: Context 13 | get() = this 14 | override val inputForTasker: TaskerInput 15 | get() = TaskerInput(Input()) 16 | 17 | private var input: Input? = null 18 | 19 | override fun assignFromInput(input: TaskerInput) { 20 | this.input = input.regular 21 | } 22 | 23 | class Input { 24 | companion object { 25 | const val TOGGLE_NAV = 0 26 | const val TOGGLE_GEST = 1 27 | } 28 | 29 | var which = TOGGLE_GEST 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/activities/ToggleGesturesActivity.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.activities 2 | 3 | import android.os.Bundle 4 | import androidx.appcompat.app.AppCompatActivity 5 | import com.xda.nobar.activities.ui.IntroActivity 6 | import com.xda.nobar.util.app 7 | 8 | /** 9 | * Simple activity to toggle NoBar's gestures 10 | * This is exported and can be called from anywhere 11 | */ 12 | class ToggleGesturesActivity : AppCompatActivity() { 13 | 14 | override fun onCreate(savedInstanceState: Bundle?) { 15 | super.onCreate(savedInstanceState) 16 | 17 | if (!IntroActivity.needsToRun(this)) 18 | app.toggleGestureBar() 19 | 20 | finish() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/activities/ToggleNavActivity.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.activities 2 | 3 | import android.os.Bundle 4 | import androidx.appcompat.app.AppCompatActivity 5 | import com.xda.nobar.util.app 6 | 7 | /** 8 | * Simple activity to toggle NoBar's navbar hiding 9 | * This is exported and can be called from anywhere 10 | */ 11 | class ToggleNavActivity : AppCompatActivity() { 12 | 13 | override fun onCreate(savedInstanceState: Bundle?) { 14 | super.onCreate(savedInstanceState) 15 | 16 | app.toggleNavState() 17 | 18 | finish() 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/activities/ui/AppDrawerActivity.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.activities.ui 2 | 3 | import android.content.ComponentName 4 | import android.content.Intent 5 | import android.content.pm.ResolveInfo 6 | import com.xda.nobar.activities.selectors.BaseAppSelectActivity 7 | import com.xda.nobar.adapters.AppSelectAdapter 8 | import com.xda.nobar.adapters.info.AppInfo 9 | import com.xda.nobar.interfaces.OnAppSelectedListener 10 | import java.util.* 11 | import kotlin.collections.ArrayList 12 | 13 | class AppDrawerActivity : BaseAppSelectActivity(), OnAppSelectedListener { 14 | private val launcherIntent = Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER) 15 | 16 | override val adapter = AppSelectAdapter(isSingleSelect = false, showSummary = true, checkListener = this, showCheck = false) 17 | 18 | override fun onAppSelected(info: AppInfo, isChecked: Boolean) { 19 | val intent = Intent(Intent.ACTION_MAIN) 20 | intent.component = ComponentName(info.packageName, info.activity) 21 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) 22 | 23 | startActivity(intent) 24 | finish() 25 | } 26 | 27 | override fun loadAppList(): ArrayList { 28 | val list = packageManager.queryIntentActivities(launcherIntent, 0) 29 | 30 | return ArrayList(list) 31 | } 32 | 33 | override fun loadAppInfo(info: ResolveInfo): AppInfo? { 34 | return AppInfo(info.activityInfo.packageName, 35 | info.activityInfo.name, 36 | info.loadLabel(packageManager).toString(), 37 | info.iconResource, 38 | false 39 | ) 40 | } 41 | 42 | override fun filter(query: String): List { 43 | val ret = ArrayList() 44 | 45 | ArrayList(origAppSet).forEach { 46 | val lowerQuery = query.toLowerCase(Locale.getDefault()) 47 | val lowerAppName = it.displayName.toLowerCase(Locale.getDefault()) 48 | val lowerPackageName = it.packageName.toLowerCase(Locale.getDefault()) 49 | 50 | if (lowerAppName.contains(lowerQuery) || lowerPackageName.contains(lowerQuery)) 51 | ret.add(it) 52 | } 53 | 54 | return ret 55 | } 56 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/activities/ui/CrashActivity.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.activities.ui 2 | 3 | import android.content.Intent 4 | import android.os.Bundle 5 | import androidx.appcompat.app.AppCompatActivity 6 | import com.xda.nobar.R 7 | import com.xda.nobar.receivers.StartupReceiver 8 | import com.xda.nobar.util.relaunch 9 | import kotlinx.android.synthetic.main.activity_crash.* 10 | 11 | class CrashActivity : AppCompatActivity() { 12 | private var isForCrashlytics = false 13 | 14 | override fun onCreate(savedInstanceState: Bundle?) { 15 | super.onCreate(savedInstanceState) 16 | setContentView(R.layout.activity_crash) 17 | 18 | enable_c_id.setOnClickListener { 19 | isForCrashlytics = true 20 | finish() 21 | } 22 | 23 | relaunch.setOnClickListener { 24 | val relaunchIntent = Intent(this, StartupReceiver::class.java) 25 | relaunchIntent.action = StartupReceiver.ACTION_RELAUNCH 26 | 27 | sendBroadcast(relaunchIntent) 28 | 29 | finish() 30 | } 31 | } 32 | 33 | override fun onDestroy() { 34 | super.onDestroy() 35 | 36 | relaunch(isForCrashlytics) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/activities/ui/HelpAboutActivity.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.activities.ui 2 | 3 | import android.os.Bundle 4 | import android.view.MenuItem 5 | import androidx.appcompat.app.AppCompatActivity 6 | import com.xda.nobar.R 7 | 8 | /** 9 | * Information about the app 10 | */ 11 | class HelpAboutActivity : AppCompatActivity() { 12 | 13 | override fun onCreate(savedInstanceState: Bundle?) { 14 | super.onCreate(savedInstanceState) 15 | setContentView(R.layout.activity_help) 16 | 17 | supportActionBar?.setDisplayShowHomeEnabled(true) 18 | supportActionBar?.setDisplayHomeAsUpEnabled(true) 19 | } 20 | 21 | override fun onOptionsItemSelected(item: MenuItem?): Boolean { 22 | when (item?.itemId) { 23 | android.R.id.home -> { 24 | finish() 25 | return true 26 | } 27 | } 28 | 29 | return super.onOptionsItemSelected(item) 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/activities/ui/LibraryActivity.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.activities.ui 2 | 3 | import android.os.Bundle 4 | import android.view.MenuItem 5 | import androidx.appcompat.app.AppCompatActivity 6 | import com.xda.nobar.R 7 | 8 | /** 9 | * List the libraries this app is using 10 | */ 11 | class LibraryActivity : AppCompatActivity() { 12 | 13 | override fun onCreate(savedInstanceState: Bundle?) { 14 | super.onCreate(savedInstanceState) 15 | setContentView(R.layout.activity_library) 16 | 17 | supportActionBar?.setDisplayHomeAsUpEnabled(true) 18 | supportActionBar?.setDisplayShowHomeEnabled(true) 19 | } 20 | 21 | override fun onOptionsItemSelected(item: MenuItem?): Boolean { 22 | when (item?.itemId) { 23 | android.R.id.home -> { 24 | finish() 25 | return true 26 | } 27 | } 28 | 29 | return super.onOptionsItemSelected(item) 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/activities/ui/SettingsActivity.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.activities.ui 2 | 3 | import android.content.Intent 4 | import android.os.Bundle 5 | import android.view.Menu 6 | import android.view.MenuItem 7 | import androidx.appcompat.app.AppCompatActivity 8 | import com.xda.nobar.R 9 | 10 | /** 11 | * The configuration activity 12 | */ 13 | class SettingsActivity : AppCompatActivity() { 14 | override fun onCreate(savedInstanceState: Bundle?) { 15 | super.onCreate(savedInstanceState) 16 | setContentView(R.layout.activity_settings) 17 | 18 | supportActionBar?.setDisplayHomeAsUpEnabled(true) 19 | supportActionBar?.setDisplayShowHomeEnabled(true) 20 | } 21 | 22 | override fun onCreateOptionsMenu(menu: Menu): Boolean { 23 | menuInflater.inflate(R.menu.menu_launch_search, menu) 24 | 25 | val searchItem = menu.findItem(R.id.launch_search) 26 | searchItem.setOnMenuItemClickListener { 27 | startActivity(Intent(this, SettingsSearchActivity::class.java)) 28 | true 29 | } 30 | 31 | return super.onCreateOptionsMenu(menu) 32 | } 33 | 34 | override fun onOptionsItemSelected(item: MenuItem?): Boolean { 35 | when (item?.itemId) { 36 | android.R.id.home -> { 37 | onBackPressed() 38 | return true 39 | } 40 | } 41 | return super.onOptionsItemSelected(item) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/activities/ui/TroubleshootingActivity.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.activities.ui 2 | 3 | import androidx.appcompat.app.AppCompatActivity 4 | import android.os.Bundle 5 | import android.view.MenuItem 6 | import com.xda.nobar.R 7 | 8 | class TroubleshootingActivity : AppCompatActivity() { 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | 12 | setContentView(R.layout.activity_troubleshooting) 13 | 14 | supportActionBar?.setDisplayHomeAsUpEnabled(true) 15 | supportActionBar?.setDisplayShowHomeEnabled(true) 16 | } 17 | 18 | override fun onOptionsItemSelected(item: MenuItem?): Boolean { 19 | return when (item?.itemId) { 20 | android.R.id.home -> { 21 | onBackPressed() 22 | true 23 | } 24 | else -> super.onOptionsItemSelected(item) 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/adapters/IntentSelectorAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.adapters 2 | 3 | import android.content.Context 4 | import android.view.LayoutInflater 5 | import android.view.View 6 | import android.view.ViewGroup 7 | import android.widget.ImageView 8 | import android.widget.TextView 9 | import androidx.core.content.ContextCompat 10 | import androidx.recyclerview.widget.SortedList 11 | import com.rey.material.widget.CheckedImageView 12 | import com.xda.nobar.R 13 | import com.xda.nobar.adapters.info.IntentInfo 14 | import com.xda.nobar.adapters.info.IntentInfoSorterCallback 15 | import com.xda.nobar.interfaces.OnIntentSelectedListener 16 | 17 | class IntentSelectorAdapter(private val callback: OnIntentSelectedListener, private val context: Context) : BaseSelectAdapter() { 18 | override val sortedApps = SortedList(IntentInfo::class.java, IntentInfoSorterCallback(this, context)) 19 | 20 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = VH(LayoutInflater.from(parent.context).inflate(R.layout.app_info_single, parent, false)) 21 | 22 | override fun onBindViewHolder(holder: VH, position: Int) { 23 | val info = sortedApps[position] 24 | val view = holder.view 25 | 26 | val title = view.findViewById(R.id.title) 27 | val summary = view.findViewById(R.id.summary) 28 | val icon = view.findViewById(R.id.icon) 29 | val check = view.findViewById(R.id.checkmark) 30 | 31 | title.text = context.resources.getString(info.res) 32 | summary.visibility = View.GONE 33 | 34 | icon.background = ContextCompat.getDrawable(view.context, R.drawable.blank) 35 | 36 | view.setOnClickListener { 37 | check.isChecked = true 38 | info.isChecked = check.isChecked 39 | 40 | (0 until sortedApps.size()) 41 | .map { index -> sortedApps[index] } 42 | .filterNot { app -> app == info } 43 | .filter { app -> app.isChecked } 44 | .forEach { app -> 45 | app.isChecked = false 46 | notifyItemChanged(sortedApps.indexOf(app)) 47 | } 48 | 49 | callback.onIntentSelected(info) 50 | } 51 | 52 | check.isChecked = info.isChecked 53 | } 54 | 55 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/adapters/ShortcutSelectAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.adapters 2 | 3 | import android.annotation.SuppressLint 4 | import android.view.LayoutInflater 5 | import android.view.ViewGroup 6 | import androidx.core.content.ContextCompat 7 | import androidx.core.content.res.ResourcesCompat 8 | import androidx.recyclerview.widget.SortedList 9 | import com.xda.nobar.R 10 | import com.xda.nobar.adapters.info.ShortcutInfo 11 | import com.xda.nobar.adapters.info.ShortcutInfoSorterCallback 12 | import com.xda.nobar.interfaces.OnShortcutSelectedListener 13 | import com.xda.nobar.util.toBitmapDrawable 14 | import kotlinx.android.synthetic.main.app_info_single.view.* 15 | 16 | class ShortcutSelectAdapter( 17 | private val checkListener: OnShortcutSelectedListener 18 | ) : BaseSelectAdapter() { 19 | override val sortedApps = SortedList(ShortcutInfo::class.java, 20 | ShortcutInfoSorterCallback(this)) 21 | 22 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = 23 | VH(LayoutInflater.from(parent.context) 24 | .inflate(R.layout.app_info_single, parent, false)) 25 | 26 | @SuppressLint("SetTextI18n") 27 | override fun onBindViewHolder(holder: VH, position: Int) { 28 | val item = sortedApps[position] 29 | val view = holder.view 30 | 31 | view.title.text = item.label 32 | view.summary.text = "${item.packageName}/${item.clazz}" 33 | 34 | val res = view.context.packageManager.getResourcesForApplication(item.packageName) 35 | 36 | view.icon.background = try { 37 | ResourcesCompat.getDrawable(res, item.icon, res.newTheme())?.toBitmapDrawable(view.context.resources) 38 | } catch (e: Exception) { 39 | ContextCompat.getDrawable(view.context, R.drawable.blank) 40 | } 41 | 42 | view.setOnClickListener { 43 | view.checkmark.isChecked = true 44 | item.isChecked = true 45 | 46 | (0 until sortedApps.size()) 47 | .map { int -> sortedApps[int] } 48 | .filterNot { info -> info == item } 49 | .filter { info -> info.isChecked } 50 | .forEach { info -> 51 | info.isChecked = false 52 | notifyItemChanged(sortedApps.indexOf(info)) 53 | } 54 | 55 | checkListener.onShortcutSelected(item) 56 | } 57 | 58 | view.checkmark.isChecked = item.isChecked 59 | } 60 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/adapters/info/ActionInfo.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.adapters.info 2 | 3 | import android.os.Parcel 4 | import android.os.Parcelable 5 | 6 | class ActionInfo( 7 | val label: CharSequence, 8 | val res: CharSequence?, 9 | val isHeader: Boolean 10 | ) : Parcelable { 11 | constructor(parcel: Parcel) : this( 12 | parcel.readString(), 13 | parcel.readString(), 14 | parcel.readByte() != 0.toByte()) 15 | 16 | override fun writeToParcel(parcel: Parcel, flags: Int) { 17 | parcel.writeString(label.toString()) 18 | parcel.writeString(res?.toString()) 19 | parcel.writeByte(if (isHeader) 1 else 0) 20 | } 21 | 22 | override fun describeContents(): Int { 23 | return 0 24 | } 25 | 26 | companion object CREATOR : Parcelable.Creator { 27 | override fun createFromParcel(parcel: Parcel): ActionInfo { 28 | return ActionInfo(parcel) 29 | } 30 | 31 | override fun newArray(size: Int): Array { 32 | return arrayOfNulls(size) 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/adapters/info/ActionInfoSorterCallback.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.adapters.info 2 | 3 | import androidx.recyclerview.widget.RecyclerView 4 | import androidx.recyclerview.widget.SortedList 5 | 6 | class ActionInfoSorterCallback(private val adapter: RecyclerView.Adapter) : 7 | SortedList.Callback() { 8 | override fun areItemsTheSame(item1: ActionInfo?, item2: ActionInfo?) = false 9 | override fun areContentsTheSame(oldItem: ActionInfo?, newItem: ActionInfo?) = false 10 | override fun onInserted(position: Int, count: Int) = adapter.notifyItemRangeInserted(position, count) 11 | override fun onMoved(fromPosition: Int, toPosition: Int) = adapter.notifyItemMoved(fromPosition, toPosition) 12 | override fun onRemoved(position: Int, count: Int) = adapter.notifyItemRangeRemoved(position, count) 13 | override fun onChanged(position: Int, count: Int) = adapter.notifyItemRangeChanged(position, count) 14 | override fun compare(o1: ActionInfo, o2: ActionInfo) = 0 15 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/adapters/info/AppInfo.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.adapters.info 2 | 3 | import android.os.Parcelable 4 | import kotlinx.android.parcel.Parcelize 5 | 6 | /** 7 | * Simple helper class that contains relevant app information 8 | * For use by BaseAppSelectActivity 9 | * @param packageName the package name of the app 10 | * @param activity the component name of the target activity 11 | * @param displayName the display name of the app 12 | * @param isChecked whether or not this item should appear as checked in a list 13 | */ 14 | @Parcelize 15 | open class AppInfo( 16 | val packageName: String, 17 | val activity: String, 18 | val displayName: String, 19 | val icon: Int, 20 | var isChecked: Boolean 21 | ) : Parcelable { 22 | override fun describeContents(): Int { 23 | return 0 24 | } 25 | 26 | override fun equals(other: Any?): Boolean { 27 | return ( 28 | other is AppInfo && 29 | other.packageName == packageName && 30 | other.activity == activity && 31 | other.displayName == displayName && 32 | other.icon == icon 33 | ) 34 | } 35 | 36 | override fun hashCode(): Int { 37 | var result = packageName.hashCode() 38 | result = 31 * result + activity.hashCode() 39 | result = 31 * result + displayName.hashCode() 40 | result = 31 * result + icon 41 | result = 31 * result + isChecked.hashCode() 42 | return result 43 | } 44 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/adapters/info/AppInfoSorterCallback.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.adapters.info 2 | 3 | import androidx.recyclerview.widget.RecyclerView 4 | import androidx.recyclerview.widget.SortedList 5 | 6 | /** 7 | * For use by BaseAppSelectActivity 8 | * Perform certain actions when a search is made 9 | */ 10 | class AppInfoSorterCallback(private val adapter: RecyclerView.Adapter, 11 | private val activity: Boolean = false) : 12 | SortedList.Callback() { 13 | override fun areItemsTheSame(item1: AppInfo?, item2: AppInfo?) = 14 | (if (activity) item1?.activity else item1?.packageName) == (if (activity) item2?.activity else item2?.packageName) 15 | override fun areContentsTheSame(oldItem: AppInfo?, newItem: AppInfo?) = oldItem == newItem 16 | override fun onInserted(position: Int, count: Int) = adapter.notifyItemRangeInserted(position, count) 17 | override fun onMoved(fromPosition: Int, toPosition: Int) = adapter.notifyItemMoved(fromPosition, toPosition) 18 | override fun onRemoved(position: Int, count: Int) = adapter.notifyItemRangeRemoved(position, count) 19 | override fun onChanged(position: Int, count: Int) = adapter.notifyItemRangeChanged(position, count) 20 | override fun compare(o1: AppInfo, o2: AppInfo) = o1.displayName.compareTo(o2.displayName) 21 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/adapters/info/IntentInfo.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.adapters.info 2 | 3 | import android.os.Parcelable 4 | import kotlinx.android.parcel.Parcelize 5 | 6 | @Parcelize 7 | data class IntentInfo( 8 | val id: Int, 9 | val res: Int, 10 | var isChecked: Boolean 11 | ) : Parcelable { 12 | override fun describeContents(): Int { 13 | return 0 14 | } 15 | 16 | override fun equals(other: Any?): Boolean { 17 | return other is IntentInfo && 18 | other.id == id 19 | } 20 | 21 | override fun hashCode(): Int { 22 | return id 23 | } 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/adapters/info/IntentInfoSorterCallback.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.adapters.info 2 | 3 | import android.content.Context 4 | import androidx.recyclerview.widget.RecyclerView 5 | import androidx.recyclerview.widget.SortedList 6 | 7 | /** 8 | * For use by BaseAppSelectActivity 9 | * Perform certain actions when a search is made 10 | */ 11 | class IntentInfoSorterCallback(private val adapter: RecyclerView.Adapter, private val context: Context) : 12 | SortedList.Callback() { 13 | override fun areItemsTheSame(item1: IntentInfo?, item2: IntentInfo?) = item1 == item2 14 | override fun areContentsTheSame(oldItem: IntentInfo?, newItem: IntentInfo?) = oldItem == newItem 15 | override fun onInserted(position: Int, count: Int) = adapter.notifyItemRangeInserted(position, count) 16 | override fun onMoved(fromPosition: Int, toPosition: Int) = adapter.notifyItemMoved(fromPosition, toPosition) 17 | override fun onRemoved(position: Int, count: Int) = adapter.notifyItemRangeRemoved(position, count) 18 | override fun onChanged(position: Int, count: Int) = adapter.notifyItemRangeChanged(position, count) 19 | override fun compare(o1: IntentInfo, o2: IntentInfo) = context.resources.getString(o1.res).compareTo(context.resources.getString(o2.res)) 20 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/adapters/info/ShortcutInfo.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.adapters.info 2 | 3 | import android.content.Intent 4 | import android.os.Parcelable 5 | import kotlinx.android.parcel.Parcelize 6 | 7 | @Parcelize 8 | class ShortcutInfo( 9 | val clazz: String, 10 | val packageName: String, 11 | val icon: Int, 12 | var label: String, 13 | var isChecked: Boolean, 14 | var intent: Intent? = null 15 | ): Parcelable { 16 | override fun describeContents(): Int { 17 | return 0 18 | } 19 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/adapters/info/ShortcutInfoSorterCallback.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.adapters.info 2 | 3 | import androidx.recyclerview.widget.RecyclerView 4 | import androidx.recyclerview.widget.SortedList 5 | 6 | class ShortcutInfoSorterCallback( 7 | private val adapter: RecyclerView.Adapter 8 | ) : SortedList.Callback() { 9 | override fun areItemsTheSame(item1: ShortcutInfo?, item2: ShortcutInfo?) = 10 | item1?.clazz == item2?.clazz 11 | 12 | override fun onMoved(fromPosition: Int, toPosition: Int) { 13 | adapter.notifyItemMoved(fromPosition, toPosition) 14 | } 15 | 16 | override fun onChanged(position: Int, count: Int) { 17 | adapter.notifyItemRangeChanged(position, count) 18 | } 19 | 20 | override fun onInserted(position: Int, count: Int) { 21 | adapter.notifyItemRangeChanged(position, count) 22 | } 23 | 24 | override fun onRemoved(position: Int, count: Int) { 25 | adapter.notifyItemRangeRemoved(position, count) 26 | } 27 | 28 | override fun compare(o1: ShortcutInfo, o2: ShortcutInfo) = 29 | o1.clazz.compareTo(o2.clazz) 30 | 31 | override fun areContentsTheSame(oldItem: ShortcutInfo?, newItem: ShortcutInfo?) = 32 | areItemsTheSame(oldItem, newItem) 33 | 34 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/data/ColoredAppData.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.data 2 | 3 | data class ColoredAppData( 4 | val packageName: String, 5 | val color: Int 6 | ) { 7 | override fun equals(other: Any?): Boolean { 8 | return other is ColoredAppData && other.packageName == packageName 9 | } 10 | 11 | override fun hashCode(): Int { 12 | return packageName.hashCode() 13 | } 14 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/fragments/intro/DynamicForwardFragmentSlide.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.fragments.intro 2 | 3 | import com.heinrichreimersoftware.materialintro.slide.FragmentSlide 4 | 5 | /** 6 | * Same as DynamicForwardSlide but for FragmentSlides 7 | */ 8 | class DynamicForwardFragmentSlide(builder: FragmentSlide.Builder, private val action: () -> Boolean) : FragmentSlide(builder) { 9 | override fun canGoForward(): Boolean { 10 | return action.invoke() 11 | } 12 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/fragments/intro/DynamicForwardSlide.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.fragments.intro 2 | 3 | import com.heinrichreimersoftware.materialintro.slide.SimpleSlide 4 | 5 | /** 6 | * The library only checks once if the user can go forward in the simple builder 7 | * so we need to wrap that builder 8 | */ 9 | class DynamicForwardSlide(builder: SimpleSlide.Builder, private val action: () -> Boolean) : SimpleSlide(builder) { 10 | override fun canGoForward(): Boolean { 11 | return action.invoke() 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/fragments/intro/WelcomeFragment.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.fragments.intro 2 | 3 | import android.graphics.SurfaceTexture 4 | import android.media.MediaPlayer 5 | import android.os.Bundle 6 | import android.view.* 7 | import com.heinrichreimersoftware.materialintro.app.SlideFragment 8 | import com.xda.nobar.R 9 | import kotlinx.android.synthetic.main.slide_welcome.* 10 | 11 | /** 12 | * The first slide: show a welcome 13 | * Uses a custom layout to show a video instead of an image 14 | */ 15 | open class WelcomeFragment : SlideFragment(), TextureView.SurfaceTextureListener { 16 | internal open val videoRes = R.raw.nav_gesture 17 | 18 | private val mediaPlayer by lazy { MediaPlayer.create(context, videoRes) } 19 | 20 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { 21 | return inflater.inflate(R.layout.slide_welcome, container, false) 22 | } 23 | 24 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 25 | mi_image?.surfaceTextureListener = this 26 | viewCreated() 27 | } 28 | 29 | override fun onSurfaceTextureAvailable(surface: SurfaceTexture, width: Int, height: Int) { 30 | val s = Surface(surface) 31 | 32 | mediaPlayer?.setSurface(s) 33 | mediaPlayer?.start() 34 | mediaPlayer?.setOnErrorListener { _, _, _ -> 35 | mi_image?.visibility = View.GONE 36 | true 37 | } 38 | } 39 | 40 | override fun onSurfaceTextureDestroyed(surface: SurfaceTexture?): Boolean { 41 | return false 42 | } 43 | 44 | override fun onSurfaceTextureSizeChanged(surface: SurfaceTexture?, width: Int, height: Int) {} 45 | override fun onSurfaceTextureUpdated(surface: SurfaceTexture?) {} 46 | 47 | internal open fun viewCreated() { 48 | mi_title?.text = resources.getText(R.string.welcome) 49 | mi_description?.text = resources.getText(R.string.app_purpose) 50 | } 51 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/fragments/intro/WriteSecureFragment.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.fragments.intro 2 | 3 | import android.os.Bundle 4 | import android.view.LayoutInflater 5 | import android.view.View 6 | import android.view.ViewGroup 7 | import com.xda.nobar.R 8 | import kotlinx.android.synthetic.main.slide_welcome.* 9 | 10 | /** 11 | * Similar to WelcomeFragment but with a different video 12 | */ 13 | class WriteSecureFragment : WelcomeFragment() { 14 | override val videoRes = R.raw.hide_nav 15 | 16 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { 17 | return inflater.inflate(R.layout.slide_welcome, container, false) 18 | } 19 | 20 | override fun viewCreated() { 21 | mi_title?.text = resources.getText(R.string.write_secure_settings) 22 | mi_description?.text = resources.getText(R.string.write_secure_settings_desc) 23 | } 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/fragments/settings/LibraryPrefs.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.fragments.settings 2 | 3 | import android.os.Bundle 4 | import androidx.preference.PreferenceFragmentCompat 5 | import com.xda.nobar.R 6 | 7 | /** 8 | * Fragment for LibraryActivity 9 | */ 10 | class LibraryPrefs : PreferenceFragmentCompat() { 11 | override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { 12 | addPreferencesFromResource(R.xml.prefs_lib) 13 | } 14 | 15 | override fun onResume() { 16 | super.onResume() 17 | 18 | activity?.title = resources.getString(R.string.libraries) 19 | } 20 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/fragments/settings/MainFragment.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.fragments.settings 2 | 3 | import androidx.preference.Preference 4 | import com.xda.nobar.R 5 | import com.xda.nobar.util.navigateTo 6 | 7 | /** 8 | * Main settings page 9 | */ 10 | class MainFragment : BasePrefFragment() { 11 | companion object { 12 | const val GESTURES = "gestures" 13 | const val APPEARANCE = "appearance" 14 | const val BEHAVIOR = "behavior" 15 | const val COMPATIBILITY = "compatibility" 16 | const val EXPERIMENTAL = "experimental" 17 | const val BACKUP_RESTORE = "backup_and_restore" 18 | } 19 | 20 | override val resId = R.xml.prefs_main 21 | override val activityTitle by lazy { resources.getText(R.string.settings) } 22 | 23 | override fun onPreferenceTreeClick(preference: Preference?): Boolean { 24 | val (action, ret) = when (preference?.key) { 25 | GESTURES -> R.id.action_mainFragment_to_gestureFragment to true 26 | APPEARANCE -> R.id.action_mainFragment_to_appearanceFragment to true 27 | BEHAVIOR -> R.id.action_mainFragment_to_behaviorFragment to true 28 | COMPATIBILITY -> R.id.action_mainFragment_to_compatibilityFragment to true 29 | EXPERIMENTAL -> R.id.action_mainFragment_to_experimentalFragment to true 30 | BACKUP_RESTORE -> R.id.action_mainFragment_to_backupRestoreFragment to true 31 | else -> null to super.onPreferenceTreeClick(preference) 32 | } 33 | 34 | if (action != null) { 35 | navigateTo(action) 36 | } 37 | 38 | return ret 39 | } 40 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/fragments/settings/appearance/AppearanceFragment.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.fragments.settings.appearance 2 | 3 | import com.xda.nobar.R 4 | import com.xda.nobar.fragments.settings.BasePrefFragment 5 | 6 | /** 7 | * Appearance settings 8 | */ 9 | class AppearanceFragment : BasePrefFragment() { 10 | override val resId = R.xml.prefs_appearance 11 | override val activityTitle by lazy { resources.getText(R.string.appearance) } 12 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/fragments/settings/appearance/SideAppearanceFragment.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.fragments.settings.appearance 2 | 3 | import com.xda.nobar.R 4 | import com.xda.nobar.fragments.settings.BasePrefFragment 5 | 6 | class SideAppearanceFragment : BasePrefFragment() { 7 | override val resId = R.xml.prefs_side_appearance 8 | override val activityTitle by lazy { resources.getText(R.string.side_appearance) } 9 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/fragments/settings/gestures/SideGestureFragment.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.fragments.settings.gestures 2 | 3 | import com.xda.nobar.R 4 | 5 | class SideGestureFragment : GestureFragment() { 6 | override val resId = R.xml.prefs_side_gestures 7 | override val activityTitle by lazy { resources.getText(R.string.side_gestures) } 8 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/fragments/settings/search/SearchFragment.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.fragments.settings.search 2 | 3 | import android.os.Bundle 4 | import androidx.preference.Preference 5 | import androidx.preference.PreferenceFragmentCompat 6 | import com.xda.nobar.R 7 | import com.xda.nobar.activities.ui.SettingsSearchActivity 8 | import com.xda.nobar.data.SettingsIndex 9 | import com.xda.nobar.util.navigateTo 10 | 11 | class SearchFragment : PreferenceFragmentCompat(), SettingsSearchActivity.ListUpdateListener { 12 | override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { 13 | setPreferencesFromResource(R.xml.prefs_search, rootKey) 14 | 15 | (requireActivity() as SettingsSearchActivity).addListUpdateListener(this) 16 | } 17 | 18 | override fun onListUpdate(newList: List) { 19 | preferenceScreen.removeAll() 20 | 21 | newList.forEach { item -> 22 | val newPref = Preference(requireActivity()) 23 | newPref.title = item.preference.title 24 | newPref.summary = item.preference.summary 25 | newPref.key = item.preference.key 26 | newPref.icon = item.preference.icon 27 | 28 | newPref.setOnPreferenceClickListener { 29 | navigateTo(item.pageAction, it.key) 30 | true 31 | } 32 | 33 | preferenceScreen.addPreference(newPref) 34 | } 35 | } 36 | 37 | override fun onDestroy() { 38 | super.onDestroy() 39 | 40 | (requireActivity() as SettingsSearchActivity).removeListUpdateListener(this) 41 | } 42 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/interfaces/OnAppSelectedListener.java: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.interfaces; 2 | 3 | import com.xda.nobar.adapters.info.AppInfo; 4 | 5 | /** 6 | * For use in any BaseAppSelectActivity 7 | * Called when the user selects an app 8 | * Should be passed into AppSelectAdapter's constructor 9 | */ 10 | public interface OnAppSelectedListener { 11 | /** 12 | * Called when the user selects an app 13 | * @param info the information corresponding to the selected app 14 | */ 15 | void onAppSelected(AppInfo info, boolean isChecked); 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/interfaces/OnDialogChoiceMadeListener.java: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.interfaces; 2 | 3 | public interface OnDialogChoiceMadeListener { 4 | void onDialogChoiceMade(int which); 5 | } 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/interfaces/OnGestureStateChangeListener.java: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.interfaces; 2 | 3 | import com.xda.nobar.views.BarView; 4 | 5 | /** 6 | * Allow components to listen for changes in NoBar's pill state 7 | */ 8 | public interface OnGestureStateChangeListener { 9 | /** 10 | * Called when the pill is activated or deactivated 11 | * @param barView the pill view 12 | * @param activated whether the pill is onscreen or not 13 | */ 14 | void onGestureStateChange(BarView barView, boolean activated); 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/interfaces/OnIntentSelectedListener.java: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.interfaces; 2 | 3 | import com.xda.nobar.adapters.info.IntentInfo; 4 | 5 | public interface OnIntentSelectedListener { 6 | void onIntentSelected(IntentInfo info); 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/interfaces/OnItemChosenListener.java: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.interfaces; 2 | 3 | import androidx.annotation.Nullable; 4 | 5 | /** 6 | * For use by SectionableListPreference 7 | * Used to listen for the selection of an item in the list 8 | */ 9 | public interface OnItemChosenListener { 10 | /** 11 | * Called when the user selects an item 12 | * @param value the value/key of the item selected 13 | */ 14 | void onItemChosen(@Nullable String value); 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/interfaces/OnLicenseCheckResultListener.java: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.interfaces; 2 | 3 | /** 4 | * Allows components to listen for changes in the premium state 5 | */ 6 | public interface OnLicenseCheckResultListener { 7 | /** 8 | * Called when a result on a license check is available 9 | * @param valid if the user has valid premium 10 | * @param reason the explanation of the state of "valid" 11 | */ 12 | void onResult(boolean valid, String reason); 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/interfaces/OnNavBarHideStateChangeListener.java: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.interfaces; 2 | 3 | /** 4 | * Allow components to listen for changes in NoBar's nav hiding state 5 | */ 6 | public interface OnNavBarHideStateChangeListener { 7 | /** 8 | * Called when the navbar is shown or hidden 9 | * @param hidden true if the navbar was hidden by this change 10 | */ 11 | void onNavStateChange(boolean hidden); 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/interfaces/OnProgressSetListener.java: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.interfaces; 2 | 3 | /** 4 | * Used by SeekBarSwitchPreference to listen for changes in the dialog SeekBar's progress 5 | */ 6 | public interface OnProgressSetListener { 7 | /** 8 | * Called when the user presses "OK" on the dialog 9 | * @param progress the progress of the dialog SeekBar (not scaled) 10 | */ 11 | void onProgressSet(int progress); 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/interfaces/OnShortcutSelectedListener.java: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.interfaces; 2 | 3 | import com.xda.nobar.adapters.info.ShortcutInfo; 4 | 5 | public interface OnShortcutSelectedListener { 6 | void onShortcutSelected(ShortcutInfo info); 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/interfaces/ReceiverCallback.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.interfaces 2 | 3 | import android.content.Intent 4 | 5 | interface ReceiverCallback { 6 | fun onActionReceived(intent: Intent?) 7 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/prefs/NavControllerPreference.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.prefs 2 | 3 | import android.content.Context 4 | import android.util.AttributeSet 5 | import androidx.preference.Preference 6 | import com.xda.nobar.R 7 | 8 | class NavControllerPreference(context: Context, attrs: AttributeSet) : 9 | Preference(context, attrs) { 10 | 11 | var action = 0 12 | 13 | init { 14 | val array = context.theme.obtainStyledAttributes(attrs, R.styleable.NavControllerPreference, 0, 0) 15 | 16 | action = array.getResourceId(R.styleable.NavControllerPreference_preference_action, 0) 17 | 18 | array.recycle() 19 | } 20 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/prefs/PixelDPSwitch.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.prefs 2 | 3 | import android.content.Context 4 | import android.util.AttributeSet 5 | import androidx.preference.SwitchPreference 6 | import com.xda.nobar.R 7 | import java.util.* 8 | 9 | class PixelDPSwitch(context: Context, attributeSet: AttributeSet) : SwitchPreference(context, attributeSet) { 10 | var dimensionType: String 11 | get() = throw IllegalArgumentException("not a gettable value") 12 | set(value) { 13 | title = String.format( 14 | Locale.getDefault(), 15 | context.resources.getString(R.string.use_pixels), 16 | value.capitalize() 17 | ) 18 | summary = String.format( 19 | Locale.getDefault(), 20 | context.resources.getString(R.string.use_pixels_desc), 21 | value.toLowerCase() 22 | ) 23 | } 24 | 25 | init { 26 | val array = context.theme.obtainStyledAttributes(attributeSet, R.styleable.PixelDPSwitch, 0, 0) 27 | dimensionType = array.getString(R.styleable.PixelDPSwitch_dimension_name) 28 | ?: context.resources.getString(R.string.dimension) 29 | } 30 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/prefs/RedTextWarningPref.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.prefs 2 | 3 | import android.content.Context 4 | import android.graphics.Color 5 | import android.util.AttributeSet 6 | import android.widget.TextView 7 | import androidx.preference.Preference 8 | import androidx.preference.PreferenceViewHolder 9 | 10 | /** 11 | * Simple preference that sets both the title and summary text color to red 12 | * Useful for warnings 13 | */ 14 | class RedTextWarningPref : Preference { 15 | constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) 16 | constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) 17 | constructor(context: Context, attrs: AttributeSet) : super(context, attrs) 18 | constructor(context: Context) : super(context) 19 | 20 | init { 21 | isSelectable = false 22 | isEnabled = false 23 | } 24 | 25 | override fun onBindViewHolder(holder: PreferenceViewHolder) { 26 | super.onBindViewHolder(holder) 27 | 28 | val titleView = holder.itemView.findViewById(context.resources.getIdentifier("title", "id", "android")) 29 | val summaryView = holder.itemView.findViewById(context.resources.getIdentifier("summary", "id", "android")) 30 | 31 | titleView.setTextColor(Color.RED) 32 | summaryView.setTextColor(Color.RED) 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/providers/CocktailProvider.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.providers 2 | 3 | import android.app.PendingIntent 4 | import android.appwidget.AppWidgetManager 5 | import android.content.ComponentName 6 | import android.content.Context 7 | import com.samsung.android.sdk.look.cocktailbar.SlookCocktailManager 8 | import com.xda.nobar.R 9 | import com.xda.nobar.activities.MainActivity 10 | 11 | /** 12 | * Widget provider for TouchWiz's Edge Screen framework 13 | */ 14 | class CocktailProvider : BaseProvider() { 15 | override fun onUpdate(context: Context, appWidgetManager: AppWidgetManager?, appWidgetIds: IntArray?) { 16 | val manager = SlookCocktailManager.getInstance(context) 17 | val ids = manager.getCocktailIds(ComponentName(context, javaClass)) 18 | onUpdate(context, manager, ids) 19 | } 20 | 21 | override fun onUpdate(context: Context, manager: SlookCocktailManager, ids: IntArray?) { 22 | val views = handleUpdate(context, R.layout.widget_layout) 23 | val longClickPendingIntent = PendingIntent.getActivity(context, 400, MainActivity.makeIntent(context), 0) 24 | 25 | manager.setOnLongClickPendingIntent(views, R.id.root, longClickPendingIntent) 26 | 27 | if (ids != null) for (id in ids) { 28 | manager.updateCocktail(id, views) 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/providers/HomeScreenProviderHoriz.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.providers 2 | 3 | import android.appwidget.AppWidgetManager 4 | import android.content.Context 5 | import com.xda.nobar.R 6 | 7 | /** 8 | * Horizontal homescreen widget provider 9 | */ 10 | class HomeScreenProviderHoriz : BaseProvider() { 11 | override fun onUpdate(context: Context, appWidgetManager: AppWidgetManager, appWidgetIds: IntArray) { 12 | val widgetViews = handleUpdate(context, R.layout.widget_layout_horiz) 13 | 14 | for (id in appWidgetIds) { 15 | appWidgetManager.updateAppWidget(id, widgetViews) 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/providers/HomeScreenProviderVert.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.providers 2 | 3 | import android.appwidget.AppWidgetManager 4 | import android.content.Context 5 | import com.xda.nobar.R 6 | 7 | /** 8 | * Vertical homescreen widget provider 9 | */ 10 | class HomeScreenProviderVert : BaseProvider() { 11 | override fun onUpdate(context: Context, appWidgetManager: AppWidgetManager, appWidgetIds: IntArray) { 12 | val widgetViews = handleUpdate(context, R.layout.widget_layout_vertical) 13 | 14 | for (id in appWidgetIds) { 15 | appWidgetManager.updateAppWidget(id, widgetViews) 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/providers/SignBoardProvider.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.providers 2 | 3 | import android.appwidget.AppWidgetManager 4 | import android.content.Context 5 | import com.xda.nobar.R 6 | 7 | /** 8 | * Provider for the LG V10/V20 SignBoard 9 | */ 10 | class SignBoardProvider : BaseProvider() { 11 | override fun onUpdate(context: Context, appWidgetManager: AppWidgetManager, appWidgetIds: IntArray) { 12 | val widgetViews = handleUpdate(context, R.layout.widget_layout_signboard) 13 | 14 | for (id in appWidgetIds) { 15 | appWidgetManager.updateAppWidget(id, widgetViews) 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/receivers/ActionReceiver.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.receivers 2 | 3 | import android.content.BroadcastReceiver 4 | import android.content.Context 5 | import android.content.Intent 6 | import android.os.Bundle 7 | import com.xda.nobar.util.app 8 | import com.xda.nobar.util.mainScope 9 | import kotlinx.coroutines.launch 10 | 11 | class ActionReceiver : BroadcastReceiver() { 12 | companion object { 13 | const val ACTION_TOGGLE_SCREEN_ON = "toggle_screen_on" 14 | const val ACTION_SCREEN_OFF = "screen_off" 15 | const val ACTION_TOGGLE_NAV = "toggle_nav" 16 | 17 | fun toggleScreenOn(context: Context) { 18 | sendIntent(context, ACTION_TOGGLE_SCREEN_ON) 19 | } 20 | 21 | fun turnScreenOff(context: Context) { 22 | sendIntent(context, ACTION_SCREEN_OFF) 23 | } 24 | 25 | fun toggleNav(context: Context) { 26 | sendIntent(context, ACTION_TOGGLE_NAV) 27 | } 28 | 29 | private fun sendIntent(context: Context, action: String, extras: Bundle? = null) { 30 | mainScope.launch { 31 | val intent = Intent(context, ActionReceiver::class.java) 32 | intent.action = action 33 | if (extras != null) intent.putExtras(extras) 34 | 35 | try { 36 | context.sendBroadcast(intent) 37 | } catch (e: Exception) {} 38 | } 39 | } 40 | } 41 | 42 | override fun onReceive(context: Context, intent: Intent) { 43 | when (intent.action) { 44 | ACTION_TOGGLE_SCREEN_ON -> context.app.toggleScreenOn() 45 | ACTION_SCREEN_OFF -> context.app.screenOffHelper.create() 46 | ACTION_TOGGLE_NAV -> context.app.toggleNavState() 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/receivers/StartupReceiver.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.receivers 2 | 3 | import android.content.BroadcastReceiver 4 | import android.content.Context 5 | import android.content.Intent 6 | import com.xda.nobar.BuildConfig 7 | import com.xda.nobar.services.Actions 8 | 9 | class StartupReceiver : BroadcastReceiver() { 10 | companion object { 11 | const val ACTION_RELAUNCH = "${BuildConfig.APPLICATION_ID}.action.RELAUNCH" 12 | } 13 | 14 | override fun onReceive(context: Context, intent: Intent) { 15 | when (intent.action) { 16 | Intent.ACTION_BOOT_COMPLETED, 17 | Intent.ACTION_LOCKED_BOOT_COMPLETED, 18 | Intent.ACTION_MY_PACKAGE_REPLACED, 19 | ACTION_RELAUNCH -> { 20 | try { 21 | val service = Intent(context, Actions::class.java) 22 | context.startService(service) 23 | } catch (e: Exception) {} 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/root/RootWrapper.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.root 2 | 3 | import android.content.Context 4 | import com.xda.nobar.RootActions 5 | import com.xda.nobar.util.isSuAsync 6 | import com.xda.nobar.util.logicScope 7 | import eu.chainfire.librootjava.BuildConfig 8 | import eu.chainfire.librootjava.RootIPCReceiver 9 | import eu.chainfire.librootjava.RootJava 10 | import eu.chainfire.libsuperuser.Shell 11 | import kotlinx.coroutines.launch 12 | 13 | class RootWrapper(private val context: Context) { 14 | private val receiver = object : RootIPCReceiver(context, 200, RootActions::class.java) { 15 | override fun onConnect(ipc: RootActions) { 16 | synchronized(queuedActions) { 17 | actions = ipc 18 | 19 | queuedActions.forEach { it.invoke(ipc) } 20 | } 21 | } 22 | 23 | override fun onDisconnect(ipc: RootActions?) { 24 | synchronized(queuedActions) { 25 | actions = null 26 | isCreated = false 27 | } 28 | } 29 | } 30 | private var isCreated = false 31 | 32 | var actions: RootActions? = null 33 | 34 | private val queuedActions = ArrayList<(ipc: RootActions) -> Unit>() 35 | 36 | val isConnected: Boolean 37 | get() = actions != null 38 | 39 | fun onCreate() { 40 | if (!isCreated) { 41 | isCreated = true 42 | 43 | val script = 44 | RootJava.getLaunchScript(context, RootHandler::class.java, null, 45 | null, null, BuildConfig.APPLICATION_ID + ":root") 46 | 47 | isSuAsync { 48 | if (it) { 49 | logicScope.launch { 50 | Shell.SU.run(script.toTypedArray()) 51 | } 52 | } 53 | } 54 | } 55 | } 56 | 57 | fun onDestroy() { 58 | receiver.release() 59 | isCreated = false 60 | 61 | logicScope.launch { 62 | RootJava.cleanupCache(context) 63 | } 64 | } 65 | 66 | fun postAction(action: (ipc: RootActions) -> Unit) { 67 | synchronized(queuedActions) { 68 | if (actions == null) queuedActions.add(action) 69 | else action.invoke(actions!!) 70 | } 71 | } 72 | 73 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/services/KeepAliveService.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.services 2 | 3 | import android.app.NotificationChannel 4 | import android.app.NotificationManager 5 | import android.app.Service 6 | import android.content.Context 7 | import android.content.Intent 8 | import android.os.Build 9 | import android.os.IBinder 10 | import androidx.core.app.NotificationCompat 11 | import com.xda.nobar.R 12 | 13 | class KeepAliveService : Service() { 14 | companion object { 15 | private const val KEEP_ALIVE_CHANNEL = "keep_alive" 16 | } 17 | 18 | override fun onBind(intent: Intent?): IBinder? { 19 | return null 20 | } 21 | 22 | override fun onCreate() { 23 | val builder = NotificationCompat.Builder(this, KEEP_ALIVE_CHANNEL) 24 | .setSmallIcon(R.mipmap.ic_launcher) 25 | .setContentTitle(resources.getText(R.string.keep_alive)) 26 | .setContentText(resources.getText(R.string.keep_alive_service_text)) 27 | .setStyle(NotificationCompat.BigTextStyle() 28 | .bigText(resources.getText(R.string.keep_alive_service_text))) 29 | .setPriority(NotificationCompat.PRIORITY_LOW) 30 | 31 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { 32 | val channel = NotificationChannel( 33 | KEEP_ALIVE_CHANNEL, 34 | resources.getText(R.string.keep_alive), 35 | NotificationManager.IMPORTANCE_LOW 36 | ) 37 | 38 | val nm = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager 39 | nm.createNotificationChannel(channel) 40 | } 41 | 42 | startForeground(100, builder.build()) 43 | } 44 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/tasker/activities/BaseNoInputOutputActivity.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.tasker.activities 2 | 3 | import android.os.Bundle 4 | import androidx.appcompat.app.AppCompatActivity 5 | import com.joaomgcd.taskerpluginlibrary.action.TaskerPluginRunnerActionNoOutputOrInput 6 | import com.joaomgcd.taskerpluginlibrary.config.TaskerPluginConfig 7 | import com.joaomgcd.taskerpluginlibrary.config.TaskerPluginConfigHelperNoOutputOrInput 8 | import com.joaomgcd.taskerpluginlibrary.input.TaskerInput 9 | 10 | abstract class BaseNoInputOutputActivity : AppCompatActivity(), TaskerPluginConfig { 11 | override val context by lazy { this } 12 | override val inputForTasker: TaskerInput = TaskerInput(Unit) 13 | 14 | override fun assignFromInput(input: TaskerInput) {} 15 | 16 | internal abstract val helper: TaskerPluginConfigHelperNoOutputOrInput 17 | 18 | override fun onCreate(savedInstanceState: Bundle?) { 19 | super.onCreate(savedInstanceState) 20 | helper.onCreate() 21 | helper.finishForTasker() 22 | } 23 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/tasker/activities/ToggleGestureActivity.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.tasker.activities 2 | 3 | import com.joaomgcd.taskerpluginlibrary.config.TaskerPluginConfigHelperNoOutputOrInput 4 | import com.joaomgcd.taskerpluginlibrary.input.TaskerInput 5 | import com.xda.nobar.R 6 | import com.xda.nobar.tasker.runners.ToggleGestureRunner 7 | 8 | class ToggleGestureActivity : BaseNoInputOutputActivity() { 9 | override val helper: TaskerPluginConfigHelperNoOutputOrInput by lazy { 10 | object : TaskerPluginConfigHelperNoOutputOrInput(this) { 11 | override val runnerClass = ToggleGestureRunner::class.java 12 | override fun addToStringBlurb(input: TaskerInput, blurbBuilder: StringBuilder) { 13 | blurbBuilder.append(resources.getString(R.string.toggle_gestures_desc)) 14 | } 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/tasker/activities/ToggleNavActivity.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.tasker.activities 2 | 3 | import com.joaomgcd.taskerpluginlibrary.config.TaskerPluginConfigHelperNoOutputOrInput 4 | import com.joaomgcd.taskerpluginlibrary.input.TaskerInput 5 | import com.xda.nobar.R 6 | import com.xda.nobar.tasker.runners.ToggleNavRunner 7 | 8 | class ToggleNavActivity : BaseNoInputOutputActivity() { 9 | override val helper: TaskerPluginConfigHelperNoOutputOrInput by lazy { 10 | object : TaskerPluginConfigHelperNoOutputOrInput(this) { 11 | override val runnerClass = ToggleNavRunner::class.java 12 | override fun addToStringBlurb(input: TaskerInput, blurbBuilder: StringBuilder) { 13 | blurbBuilder.append(resources.getString(R.string.toggle_nav_desc)) 14 | } 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/tasker/inputs/EventInput.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.tasker.inputs 2 | 3 | import com.joaomgcd.taskerpluginlibrary.input.TaskerInputField 4 | import com.joaomgcd.taskerpluginlibrary.input.TaskerInputRoot 5 | 6 | @TaskerInputRoot 7 | open class EventInput(@field:TaskerInputField("gesture") var gesture: String? = null) -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/tasker/runners/EventRunner.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.tasker.runners 2 | 3 | import android.content.Context 4 | import com.joaomgcd.taskerpluginlibrary.condition.TaskerPluginRunnerConditionEvent 5 | import com.joaomgcd.taskerpluginlibrary.input.TaskerInput 6 | import com.joaomgcd.taskerpluginlibrary.runner.TaskerPluginResultCondition 7 | import com.joaomgcd.taskerpluginlibrary.runner.TaskerPluginResultConditionSatisfied 8 | import com.joaomgcd.taskerpluginlibrary.runner.TaskerPluginResultConditionUnsatisfied 9 | import com.xda.nobar.tasker.inputs.EventInput 10 | import com.xda.nobar.tasker.updates.EventUpdate 11 | 12 | class EventRunner : TaskerPluginRunnerConditionEvent() { 13 | override fun getSatisfiedCondition(context: Context, input: TaskerInput, update: EventUpdate?): TaskerPluginResultCondition { 14 | return if (input.regular.gesture == update?.gesture) TaskerPluginResultConditionSatisfied(context) 15 | else TaskerPluginResultConditionUnsatisfied() 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/tasker/runners/ToggleGestureRunner.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.tasker.runners 2 | 3 | import android.content.Context 4 | import com.joaomgcd.taskerpluginlibrary.action.TaskerPluginRunnerActionNoOutputOrInput 5 | import com.joaomgcd.taskerpluginlibrary.input.TaskerInput 6 | import com.joaomgcd.taskerpluginlibrary.runner.TaskerPluginResult 7 | import com.joaomgcd.taskerpluginlibrary.runner.TaskerPluginResultError 8 | import com.joaomgcd.taskerpluginlibrary.runner.TaskerPluginResultSucess 9 | import com.xda.nobar.R 10 | import com.xda.nobar.util.app 11 | import com.xda.nobar.util.runPremiumAction 12 | 13 | class ToggleGestureRunner : TaskerPluginRunnerActionNoOutputOrInput() { 14 | override fun run(context: Context, input: TaskerInput): TaskerPluginResult { 15 | return if (context.runPremiumAction { context.app.toggleGestureBar() }) TaskerPluginResultSucess() 16 | else TaskerPluginResultError(SecurityException(context.resources.getString(R.string.premium_required))) 17 | } 18 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/tasker/runners/ToggleNavRunner.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.tasker.runners 2 | 3 | import android.content.Context 4 | import com.joaomgcd.taskerpluginlibrary.action.TaskerPluginRunnerActionNoOutputOrInput 5 | import com.joaomgcd.taskerpluginlibrary.input.TaskerInput 6 | import com.joaomgcd.taskerpluginlibrary.runner.TaskerPluginResult 7 | import com.joaomgcd.taskerpluginlibrary.runner.TaskerPluginResultError 8 | import com.joaomgcd.taskerpluginlibrary.runner.TaskerPluginResultSucess 9 | import com.xda.nobar.R 10 | import com.xda.nobar.util.app 11 | import com.xda.nobar.util.runPremiumAction 12 | 13 | class ToggleNavRunner : TaskerPluginRunnerActionNoOutputOrInput() { 14 | override fun run(context: Context, input: TaskerInput): TaskerPluginResult { 15 | return if (context.runPremiumAction { context.app.toggleNavState() }) TaskerPluginResultSucess() 16 | else TaskerPluginResultError(SecurityException(context.resources.getString(R.string.premium_required))) 17 | } 18 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/tasker/updates/EventUpdate.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.tasker.updates 2 | 3 | import com.joaomgcd.taskerpluginlibrary.input.TaskerInputField 4 | import com.joaomgcd.taskerpluginlibrary.input.TaskerInputRoot 5 | 6 | @TaskerInputRoot 7 | class EventUpdate(@field:TaskerInputField("gesture") var gesture: String? = null) -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/tiles/GestureToggle.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.tiles 2 | 3 | import android.annotation.TargetApi 4 | import android.os.Build 5 | import android.service.quicksettings.Tile 6 | import android.service.quicksettings.TileService 7 | import com.xda.nobar.R 8 | import com.xda.nobar.interfaces.OnGestureStateChangeListener 9 | import com.xda.nobar.util.app 10 | import com.xda.nobar.util.prefManager 11 | import com.xda.nobar.views.BarView 12 | 13 | /** 14 | * QS Tile to toggle NoBar gestures 15 | */ 16 | @TargetApi(24) 17 | class GestureToggle : TileService(), OnGestureStateChangeListener { 18 | private var isCreated = false 19 | 20 | override fun onCreate() { 21 | isCreated = true 22 | 23 | app.addGestureActivationListener(this) 24 | } 25 | 26 | override fun onStartListening() { 27 | updateState() 28 | } 29 | 30 | override fun onDestroy() { 31 | isCreated = false 32 | 33 | super.onDestroy() 34 | app.removeGestureActivationListener(this) 35 | } 36 | 37 | override fun onClick() { 38 | app.toggleGestureBar() 39 | updateState() 40 | } 41 | 42 | override fun onGestureStateChange(barView: BarView?, activated: Boolean) { 43 | updateState() 44 | } 45 | 46 | @TargetApi(Build.VERSION_CODES.N) 47 | private fun updateState() { 48 | val active = prefManager.isActive 49 | 50 | qsTile?.apply { 51 | state = if (active) Tile.STATE_ACTIVE else Tile.STATE_INACTIVE 52 | label = resources.getText(if (active) R.string.gestures_on else R.string.gestures_off) 53 | 54 | if (isCreated) { 55 | try { 56 | updateTile() 57 | } catch (e: IllegalArgumentException) { 58 | e.printStackTrace() 59 | } 60 | } 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/tiles/NavBarToggle.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.tiles 2 | 3 | import android.annotation.TargetApi 4 | import android.graphics.drawable.Icon 5 | import android.os.Build 6 | import android.service.quicksettings.Tile 7 | import android.service.quicksettings.TileService 8 | import com.xda.nobar.R 9 | import com.xda.nobar.interfaces.OnNavBarHideStateChangeListener 10 | import com.xda.nobar.util.app 11 | import com.xda.nobar.util.checkNavHiddenAsync 12 | 13 | /** 14 | * QS Tile to toggle navbar 15 | */ 16 | @TargetApi(24) 17 | class NavBarToggle : TileService(), OnNavBarHideStateChangeListener { 18 | private var isCreated = false 19 | 20 | override fun onCreate() { 21 | isCreated = true 22 | 23 | app.addNavBarHideListener(this) 24 | } 25 | 26 | override fun onStartListening() { 27 | updateState() 28 | } 29 | 30 | override fun onDestroy() { 31 | isCreated = false 32 | 33 | super.onDestroy() 34 | app.removeNavBarHideListener(this) 35 | } 36 | 37 | override fun onClick() { 38 | app.toggleNavState() 39 | updateState() 40 | } 41 | 42 | override fun onNavStateChange(hidden: Boolean) { 43 | updateState() 44 | } 45 | 46 | @TargetApi(Build.VERSION_CODES.N) 47 | private fun updateState() { 48 | checkNavHiddenAsync { active -> 49 | qsTile?.apply { 50 | state = if (active) Tile.STATE_ACTIVE else Tile.STATE_INACTIVE 51 | icon = Icon.createWithResource(packageName, (if (active) R.drawable.border_clear else R.drawable.border_bottom)) 52 | label = resources.getText(if (active) R.string.nav_hidden else R.string.nav_shown) 53 | 54 | if (isCreated) { 55 | try { 56 | updateTile() 57 | } catch (e: IllegalArgumentException) { 58 | e.printStackTrace() 59 | } 60 | } 61 | } 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/util/CrashHandler.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.util 2 | 3 | import android.app.AlarmManager 4 | import android.app.PendingIntent 5 | import android.content.Context 6 | import android.content.Intent 7 | import android.os.DeadObjectException 8 | import android.os.Process 9 | import android.os.SystemClock 10 | import android.util.Log 11 | import com.crashlytics.android.Crashlytics 12 | import com.xda.nobar.BuildConfig 13 | import com.xda.nobar.activities.ui.CrashActivity 14 | 15 | class CrashHandler(private val prevHandler: Thread.UncaughtExceptionHandler?, private val context: Context) : Thread.UncaughtExceptionHandler { 16 | private var isCrashing = false 17 | 18 | override fun uncaughtException(t: Thread?, e: Throwable) { 19 | if (!isCrashing) { 20 | isCrashing = true 21 | 22 | val needsToLog = needsLog(e) 23 | 24 | val crashIntent = PendingIntent.getActivity( 25 | context, 26 | 100, 27 | Intent(context, CrashActivity::class.java), 28 | PendingIntent.FLAG_ONE_SHOT 29 | ) 30 | 31 | val am = context.getSystemService(Context.ALARM_SERVICE) as AlarmManager 32 | am.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + 100, crashIntent) 33 | 34 | if (needsToLog) { 35 | prevHandler?.uncaughtException(t, e) 36 | Log.e("NoBar", "Fatal Error", e) 37 | } else { 38 | if (e !is DeadObjectException) { 39 | Crashlytics.logException(e) 40 | } 41 | } 42 | 43 | Process.killProcess(Process.myPid()) 44 | } 45 | } 46 | 47 | private fun needsLog(parent: Throwable): Boolean { 48 | var needsLog = false 49 | 50 | val cause = parent.cause 51 | 52 | if (cause != null) needsLog = needsLog(cause) 53 | else { 54 | val trace = parent.stackTrace 55 | 56 | trace.forEach { 57 | if (it.className.contains(BuildConfig.APPLICATION_ID)) { 58 | needsLog = true 59 | return@forEach 60 | } 61 | } 62 | } 63 | 64 | return needsLog 65 | } 66 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/util/IImersiveHelperManager.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.util 2 | 3 | import android.os.Binder 4 | 5 | abstract class IImersiveHelperManager : Binder() { 6 | abstract fun enterNavImmersive() 7 | abstract fun exitNavImmersive() 8 | abstract fun isNavImmersive(): Boolean 9 | abstract fun isStatusImmersive(): Boolean 10 | abstract fun isFullImmersive(): Boolean 11 | abstract fun isFullPolicyControl(): Boolean 12 | abstract fun isNavPolicyControl(): Boolean 13 | abstract fun isStatusPolicyControl(): Boolean 14 | abstract fun tempForcePolicyControlForRecents() 15 | abstract fun putBackOldImmersive() 16 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/util/LogicHandler.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.util 2 | 3 | import android.os.Handler 4 | import android.os.Looper 5 | 6 | class LogicHandler(looper: Looper) : Handler(looper) { 7 | fun postLogged(runnable: () -> Unit): Boolean { 8 | return post(runnable) 9 | } 10 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/util/backup/AppearanceBackupRestoreManager.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.util.backup 2 | 3 | import android.content.Context 4 | import com.xda.nobar.R 5 | 6 | class AppearanceBackupRestoreManager(context: Context) : BaseBackupRestoreManager(context) { 7 | override val type = "appearance" 8 | override val name = "Appearance" 9 | override val prefsRes = arrayOf(R.xml.prefs_appearance, R.xml.prefs_pill_appearance, R.xml.prefs_side_appearance) 10 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/util/backup/BehaviorBackupRestoreManager.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.util.backup 2 | 3 | import android.content.Context 4 | import android.net.Uri 5 | import com.xda.nobar.R 6 | import com.xda.nobar.util.PrefManager 7 | import com.xda.nobar.util.prefManager 8 | 9 | class BehaviorBackupRestoreManager(context: Context) : BaseBackupRestoreManager(context) { 10 | override val type = "behavior" 11 | override val name = "Behavior" 12 | override val prefsRes = arrayOf(R.xml.prefs_behavior) 13 | 14 | override fun saveBackup(dest: Uri) { 15 | val data = buildData() 16 | 17 | data[PrefManager.AUTO_HIDE_PILL_PROGRESS] = prefManager.get(PrefManager.AUTO_HIDE_PILL_PROGRESS) 18 | data[PrefManager.HIDE_IN_FULLSCREEN_PROGRESS] = prefManager.get(PrefManager.HIDE_IN_FULLSCREEN_PROGRESS) 19 | data[PrefManager.HIDE_PILL_ON_KEYBOARD_PROGRESS] = prefManager.get(PrefManager.HIDE_PILL_ON_KEYBOARD_PROGRESS) 20 | data[PrefManager.FADE_AFTER_SPECIFIED_DELAY_PROGRESS] = prefManager.get(PrefManager.FADE_AFTER_SPECIFIED_DELAY_PROGRESS) 21 | data[PrefManager.FADE_IN_FULLSCREEN_APPS_PROGRESS] = prefManager.get(PrefManager.FADE_IN_FULLSCREEN_APPS_PROGRESS) 22 | 23 | serialize(dest, data) 24 | } 25 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/util/backup/GestureBackupRestoreManager.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.util.backup 2 | 3 | import android.content.Context 4 | import android.net.Uri 5 | import com.xda.nobar.util.PrefManager 6 | import com.xda.nobar.util.prefManager 7 | 8 | class GestureBackupRestoreManager(context: Context) : BaseBackupRestoreManager(context) { 9 | override val type = "gesture" 10 | override val name = "Gesture" 11 | override val prefsRes = arrayOf() 12 | 13 | override fun saveBackup(dest: Uri) { 14 | val data = HashMap() 15 | val currentActions = HashMap().apply { prefManager.getActionsList(this) } 16 | 17 | data.putAll(currentActions) 18 | data[PrefManager.SECTIONED_PILL] = prefManager.sectionedPill 19 | 20 | serialize(dest, data) 21 | } 22 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/util/backup/OmniBackupRestoreManager.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.util.backup 2 | 3 | import android.content.Context 4 | import android.net.Uri 5 | import com.xda.nobar.util.prefManager 6 | 7 | class OmniBackupRestoreManager(context: Context) : BaseBackupRestoreManager(context) { 8 | override val type = "omni" 9 | override val name = "Omni" 10 | override val prefsRes = arrayOf() 11 | 12 | override fun saveBackup(dest: Uri) { 13 | val data = HashMap() 14 | 15 | data.putAll(prefManager.all) 16 | 17 | serialize(dest, data) 18 | } 19 | 20 | override fun onBeforeApply() { 21 | prefManager.clear() 22 | } 23 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/util/flashlight/FlashlightControllerBase.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.util.flashlight 2 | 3 | import android.content.Context 4 | 5 | abstract class FlashlightControllerBase(internal open val context: Context) { 6 | abstract var flashlightEnabled: Boolean 7 | var isCreated = false 8 | 9 | open fun toggle() { 10 | flashlightEnabled = !flashlightEnabled 11 | } 12 | open fun onCreate(callback: (() -> Unit)? = null) {} 13 | open fun onDestroy(callback: (() -> Unit)? = null) {} 14 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/util/flashlight/FlashlightControllerLollipop.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("DEPRECATION") 2 | 3 | package com.xda.nobar.util.flashlight 4 | 5 | import android.content.Context 6 | import android.hardware.Camera 7 | 8 | class FlashlightControllerLollipop(override val context: Context) : FlashlightControllerBase(context) { 9 | override var flashlightEnabled: Boolean 10 | get() { 11 | return camera?.parameters?.flashMode == Camera.Parameters.FLASH_MODE_TORCH 12 | } 13 | set(value) { 14 | if (value) { 15 | camera = Camera.open() 16 | val parameters = camera?.parameters 17 | parameters?.flashMode = Camera.Parameters.FLASH_MODE_TORCH 18 | camera?.parameters = parameters 19 | 20 | camera?.startPreview() 21 | } else { 22 | camera?.stopPreview() 23 | camera?.release() 24 | camera = null 25 | } 26 | } 27 | 28 | private var camera: Camera? = null 29 | 30 | override fun onCreate(callback: (() -> Unit)?) { 31 | isCreated = true 32 | callback?.invoke() 33 | } 34 | 35 | override fun onDestroy(callback: (() -> Unit)?) { 36 | isCreated = false 37 | callback?.invoke() 38 | } 39 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/util/helpers/DisabledReasonManager.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.util.helpers 2 | 3 | /** 4 | * Base class for managing the reasons for why certain features are currently disabled 5 | */ 6 | open class DisabledReasonManager : HashSet() { 7 | object NavBarReasons { 8 | const val NAV_BLACKLIST = "nav_blacklist" 9 | const val CAR_MODE = "car_mode" 10 | const val KEYGUARD = "keyguard" 11 | const val KEYBOARD = "keyboard" 12 | const val FULLSCREEN = "fullscreen" 13 | const val VOLUME_LANDSCAPE = "volume" 14 | const val APP_PINNED = "app_pinned" 15 | } 16 | 17 | object PillReasons { 18 | const val BLACKLIST = "bar_blacklist" 19 | const val CAR_MODE = "bar_car_mode" 20 | const val LOCK_SCREEN = "lock_screen" 21 | const val PERMISSIONS_DIALOG = "permissions_dialog" 22 | const val PERMISSIONS_ACTIVITY = "permissions_activity" 23 | const val MEDIA_PROJECTION = "media_projection" 24 | const val INSTALLER = "installer" 25 | const val SCREEN_OFF = "screen_off" 26 | const val HIDE_DIALOG = "hide_dialog" 27 | } 28 | 29 | object ImmReasons { 30 | const val BLACKLIST = "imm_blacklist" 31 | const val EDGE_SCREEN = "edge" 32 | } 33 | 34 | object BlackoutReasons { 35 | const val KEYGUARD = "keyguard" 36 | const val KEYBOARD = "keyboard" 37 | } 38 | 39 | fun setConditional(reason: String, condition: (reason: String) -> Boolean) { 40 | synchronized(this) { 41 | if (condition(reason)) add(reason) 42 | else remove(reason) 43 | } 44 | } 45 | 46 | override fun add(element: String): Boolean { 47 | synchronized(this) { 48 | return super.add(element) 49 | } 50 | } 51 | 52 | override fun remove(element: String): Boolean { 53 | synchronized(this) { 54 | return super.remove(element) 55 | } 56 | } 57 | 58 | override fun addAll(elements: Collection): Boolean { 59 | synchronized(this) { 60 | return super.addAll(elements) 61 | } 62 | } 63 | 64 | override fun removeAll(elements: Collection): Boolean { 65 | synchronized(this) { 66 | return super.removeAll(elements) 67 | } 68 | } 69 | 70 | override fun clear() { 71 | synchronized(this) { 72 | super.clear() 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/util/helpers/GsonHandlers.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.util.helpers 2 | 3 | import android.content.Intent 4 | import android.net.Uri 5 | import com.google.gson.* 6 | import java.lang.reflect.Type 7 | 8 | class GsonUriHandler : JsonSerializer, JsonDeserializer { 9 | override fun serialize(src: Uri, typeOfSrc: Type, context: JsonSerializationContext): JsonElement { 10 | return JsonPrimitive(src.toString()) 11 | } 12 | 13 | override fun deserialize( 14 | src: JsonElement, srcType: Type, 15 | context: JsonDeserializationContext 16 | ): Uri? { 17 | return try { 18 | Uri.parse(src.asString) 19 | } catch (e: Exception) { 20 | null 21 | } 22 | } 23 | } 24 | 25 | class GsonIntentHandler : JsonSerializer, JsonDeserializer { 26 | override fun serialize(src: Intent, typeOfSrc: Type, context: JsonSerializationContext?): JsonElement { 27 | return JsonPrimitive(src.toUri(0)) 28 | } 29 | 30 | override fun deserialize(json: JsonElement, typeOfT: Type, context: JsonDeserializationContext): Intent? { 31 | return try { 32 | Intent.parseUri(json.asString, 0) 33 | } catch (e: Exception) { 34 | null 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/util/helpers/HiddenPillReasonManagerNew.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.util.helpers 2 | 3 | import java.util.* 4 | 5 | class HiddenPillReasonManagerNew : TreeMap() { 6 | companion object { 7 | const val AUTO = "auto" 8 | const val FULLSCREEN = "fullscreen" 9 | const val KEYBOARD = "keyboard" 10 | const val MANUAL = "manual" 11 | } 12 | 13 | fun getMostRecentReason(): String? { 14 | synchronized(this) { 15 | return lastEntry()?.value 16 | } 17 | } 18 | 19 | fun removeReason(reason: String) { 20 | synchronized(this) { 21 | //Singleton collection to remove all 22 | values.removeAll(Collections.singleton(reason)) 23 | } 24 | } 25 | 26 | fun addReason(reason: String) { 27 | synchronized(this) { 28 | val time = System.currentTimeMillis() 29 | 30 | put(time, reason) 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xda/nobar/views/TextSwitch.kt: -------------------------------------------------------------------------------- 1 | package com.xda.nobar.views 2 | 3 | import android.content.Context 4 | import android.util.AttributeSet 5 | import android.util.TypedValue 6 | import android.view.View 7 | import android.widget.CompoundButton 8 | import android.widget.FrameLayout 9 | import com.xda.nobar.R 10 | import kotlinx.android.synthetic.main.text_switch.view.* 11 | 12 | class TextSwitch(context: Context, attributeSet: AttributeSet?) : FrameLayout(context, attributeSet) { 13 | var isChecked: Boolean 14 | get() = switch1.isChecked 15 | set(value) { switch1.isChecked = value } 16 | 17 | var onCheckedChangeListener: CompoundButton.OnCheckedChangeListener? = null 18 | set(value) { switch1.setOnCheckedChangeListener(value) } 19 | 20 | var titleText: CharSequence? 21 | get() = title.text 22 | set(value) { title.text = value } 23 | 24 | var summaryText: CharSequence? 25 | get() = summary.text 26 | set(value) { 27 | summary.text = value 28 | if (value.isNullOrEmpty()) summary.visibility = View.GONE 29 | else summary.visibility = View.VISIBLE 30 | } 31 | 32 | init { 33 | View.inflate(context, R.layout.text_switch, this) 34 | 35 | val array = context.theme.obtainStyledAttributes(attributeSet, R.styleable.TextSwitch, 0, 0) 36 | 37 | try { 38 | val titleSize = array.getDimensionPixelSize(R.styleable.TextSwitch_title_text_size, 0) 39 | if (titleSize != 0) title.setTextSize(TypedValue.COMPLEX_UNIT_PX, titleSize.toFloat()) 40 | 41 | val summarySize = array.getDimensionPixelSize(R.styleable.TextSwitch_summary_text_size, 0) 42 | if (summarySize != 0) summary.setTextSize(TypedValue.COMPLEX_UNIT_PX, summarySize.toFloat()) 43 | 44 | titleText = array.getText(R.styleable.TextSwitch_title_text) 45 | summaryText = array.getText(R.styleable.TextSwitch_summary_text) 46 | } finally { 47 | array.recycle() 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable-v26/ic_shortcut_gesture.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v26/ic_shortcut_nav.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v26/ic_shortcut_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/anchor_white.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/animation.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/arrow_down.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/arrow_up.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/autorenew.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/backup.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/blank.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/border_bottom.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/border_clear.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/border_clear_108.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/car.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/circle.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/circle_small.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/color_circle.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/color_lens.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/done.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/double_tap.xml: -------------------------------------------------------------------------------- 1 | 7 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/edge_line.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/expand_horizontal.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/expand_vertical.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/fullscreen.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/gesture.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/gesture_accent_108.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/gesture_outline.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/hearing.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_add_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_bug_report.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_complex_down_left.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_complex_down_left_long.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_complex_down_right.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_complex_down_right_long.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_complex_up_left.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_complex_up_left_long.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_complex_up_right.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_complex_up_right_long.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_delete_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_gradient.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 6 | 8 | 11 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_layers_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_navgest.xml: -------------------------------------------------------------------------------- 1 | 6 | 13 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_opacity.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_repeat_24dp.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_search_24dp.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_shortcut_gesture.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_shortcut_nav.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_shortcut_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_transition.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_vibration.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/info.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/keyboard.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/keyboard_hide.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/nav_acc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/src/main/res/drawable/nav_acc.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/nav_overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/src/main/res/drawable/nav_overlay.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/palette_white.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/pill_div.xml: -------------------------------------------------------------------------------- 1 | 6 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/pill_drawable.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 11 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/pill_tap_flash.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/pill_tap_ripple.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/qs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/src/main/res/drawable/qs.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/refresh.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/reset.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/restore.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/rounded_corner.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/screen_rotation.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/settings.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/settings_accent_108.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shadow.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/storage.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/swap_horizontal.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/swap_vertical.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/swipe_down.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/swipe_left.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/swipe_right.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/swipe_up.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/swipe_up_hold.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/tap.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/tap_hold.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/test_tube.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/visibility_off.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/warning.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/widget_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_app_color_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 13 | 14 | 26 | 27 | 37 | 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_app_launch_select.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 22 | 23 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_blank.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_help.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_library.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 20 | 21 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_preference_viewer.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_troubleshooting.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/layout/colored_app_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 23 | 24 | 31 | 32 | 37 | 38 | 45 | 46 | 52 | 53 | 54 | 55 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /app/src/main/res/layout/help_button.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/layout/preference_view_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 21 | 22 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/layout/settings_button.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/layout/text_input.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/text_switch.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 17 | 18 | 25 | 26 | 32 | 33 | 34 | 35 | 40 | 41 | -------------------------------------------------------------------------------- /app/src/main/res/layout/use_recommended_settings_dialog_message_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 23 | 24 | 31 | 32 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /app/src/main/res/layout/zero_height_pref.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_launch_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/src/main/res/mipmap-hdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/src/main/res/mipmap-mdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/navigation/main_graph.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 13 | 16 | 17 | 21 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/navigation/troubleshooting_graph.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 13 | 16 | 19 | 22 | 25 | 26 | 30 | 34 | 38 | 42 | 46 | 47 | -------------------------------------------------------------------------------- /app/src/main/res/raw/hide_nav.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/src/main/res/raw/hide_nav.mp4 -------------------------------------------------------------------------------- /app/src/main/res/raw/nav_gesture.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/app/src/main/res/raw/nav_gesture.mp4 -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/values/bools.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | true 5 | true 6 | true 7 | true 8 | false 9 | false 10 | false 11 | false 12 | false 13 | true 14 | false 15 | false 16 | false 17 | false 18 | true 19 | false 20 | false 21 | false 22 | false 23 | false 24 | false 25 | false 26 | false 27 | true 28 | false 29 | true 30 | true 31 | false 32 | false 33 | true 34 | false 35 | false 36 | false 37 | false 38 | false 39 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #323232 4 | #181818 5 | #ff9338 6 | 7 | #cccccc 8 | #222222 9 | #00000000 10 | #aaa 11 | #ffffff 12 | #33000000 13 | @color/pill_color 14 | 15 | #c62828 16 | #d84315 17 | #ef6c00 18 | #f9a825 19 | #2e7d32 20 | #283593 21 | #4527a0 22 | 23 | #b71c1c 24 | #bf360c 25 | #e65100 26 | #f57f17 27 | #1b5e20 28 | #1a237e 29 | #311b92 30 | 31 | @color/colorPrimary 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8dp 4 | 12dp 5 | 4dp 6 | 7 | 8dp 8 | 22dp 9 | 112dp 10 | 11 | 1dp 12 | -------------------------------------------------------------------------------- /app/src/main/res/xml/actions.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/xml/backup_rules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/xml/cocktail.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/xml/prefs_about.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 15 | 16 | 21 | 22 | 27 | 28 | 33 | 34 | 39 | 40 | 45 | 46 | 50 | 51 | 52 | 53 | 54 | 55 | 61 | 62 | 67 | 68 | 73 | 74 | -------------------------------------------------------------------------------- /app/src/main/res/xml/prefs_appearance.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 11 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/xml/prefs_backup_restore.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 13 | 14 | 20 | 21 | 22 | 23 | 25 | 26 | 31 | 32 | 37 | 38 | 39 | 40 | 42 | 43 | 48 | 49 | 54 | 55 | 56 | 57 | 59 | 60 | 65 | 66 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /app/src/main/res/xml/prefs_experimental.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 15 | 16 | 22 | 23 | 30 | 31 | 38 | 39 | 46 | 47 | 52 | 57 | 58 | 59 | 65 | 66 | -------------------------------------------------------------------------------- /app/src/main/res/xml/prefs_gestures.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 18 | 19 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/xml/prefs_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 17 | 18 | 24 | 25 | 31 | 32 | 37 | 38 | 43 | 44 | -------------------------------------------------------------------------------- /app/src/main/res/xml/prefs_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/xml/prefs_side_gestures.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | 17 | 18 | 26 | 27 | 35 | 36 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /app/src/main/res/xml/shortcuts.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 12 | 17 | 18 | 19 | 20 | 26 | 27 | 32 | 33 | 34 | 35 | 41 | 42 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /app/src/main/res/xml/signboard.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/xml/widget.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/xml/widget_vertical.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.60-eap-25' 3 | repositories { 4 | google() 5 | jcenter() 6 | maven { 7 | url "http://jitpack.io" 8 | } 9 | maven { 10 | url 'https://maven.fabric.io/public' 11 | } 12 | maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' } 13 | } 14 | dependencies { 15 | classpath 'com.android.tools.build:gradle:3.5.1' 16 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 17 | classpath 'com.google.gms:google-services:4.3.2' 18 | classpath 'com.google.firebase:firebase-plugins:2.0.0' 19 | classpath 'io.fabric.tools:gradle:1.28.0' 20 | } 21 | } 22 | 23 | allprojects { 24 | repositories { 25 | google() 26 | jcenter() 27 | maven { 28 | url "http://jitpack.io" 29 | } 30 | maven { 31 | url 'https://maven.google.com/' 32 | } 33 | maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' } 34 | } 35 | } 36 | 37 | task clean(type: Delete) { 38 | delete rootProject.buildDir 39 | } 40 | -------------------------------------------------------------------------------- /crowdin.yml: -------------------------------------------------------------------------------- 1 | files: 2 | - source: /app/src/main/res/values/strings.xml 3 | translation: /app/src/main/res/values_%two_letters_code%/strings.xml 4 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | 15 | android.useAndroidX=true 16 | android.enableJetifier=true -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xda/navigation-gestures/57502f8b2a6060aed0287bf9af1751904b457f2b/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Oct 23 15:43:03 EDT 2019 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-5.6.1-all.zip 7 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | //project(':seekbar').projectDir = file("/../SeekBarPreference/library") --------------------------------------------------------------------------------