This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "title": "Language toggler", | |
| "rules": [ | |
| { | |
| "description": "Left_Shift+Left_Command=Ru", | |
| "manipulators": [ | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "left_shift", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun main(args: Array<String>) { | |
| Inner().nodes() | |
| readLine() | |
| System.gc() | |
| readLine() | |
| } | |
| class Inner { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main() { | |
| print(getAttribute<List<String>>(['1', '2'])); | |
| } | |
| T getAttribute<T>(dynamic rawAttribute) { | |
| switch (T) { | |
| case bool: | |
| return rawAttribute ?? false; | |
| case String: | |
| return rawAttribute ?? ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main() { | |
| final result = SuccessFailure<int, void>.success(null); | |
| if (result.isSuccess) { // надо будет result.isSuccess && result.success != null. Вообще весь смысл этого класса теряется | |
| print(result.success + 5); | |
| } | |
| } | |
| typedef Callback<T> = void Function(T value); | |
| class SuccessFailure<S, F> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main() async { | |
| upload(1).listen((event) {}); | |
| await Future.delayed(Duration(seconds: 1)); | |
| upload(2).listen((event) {}); | |
| await Future.delayed(Duration(seconds: 1)); | |
| upload(3).listen((event) {}); | |
| await Future.delayed(Duration(seconds: 1)); | |
| upload(4).listen((event) {}); | |
| await Future.delayed(Duration(seconds: 1)); | |
| upload(5).listen((event) {}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public interface BillingClientWithLifecycle extends LifecycleObserver { | |
| Subject<BillingResult> getPurchases(); | |
| Subject<List<AvailableProductDetails>> getAvailablePurchasesDetails(); | |
| void updatePurchases(); | |
| void onPurchasesUpdated(int responseCode, @Nullable List<BillingClientWithLifecycle.OwnedProduct> purchases); | |
| void launchBillingFlow(Activity activity, String productId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Override | |
| public void onAccessibilityEvent(final AccessibilityEvent event) { | |
| ... | |
| UsageAccessHelper.ActivityData realActivity = appStatsHelper.getCurrentActivity(); | |
| realActivityName = realActivity.getActivityFullName(); | |
| checkIfPictureInPicture(realActivityName); | |
| } | |
| private void checkIfPictureInPicture(String activityName) { | |
| if ("com.android.systemui/.pip.phone.PipMenuActivity".equals(activityName)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Looks like there is no adequate way to listen to this permission change, so do workaround here. | |
| * Normally, we check the permission every 0.5 second. But on Oreo this won't work as Settings.canDrawOverlays still | |
| * returns false after activation but before returning to the app (bug https://issuetracker.google.com/issues/66072795). | |
| * Use OnOpChangedListener on Oreo. | |
| */ | |
| public class DrawOverPermissionActivationListener implements LifecycleObserver { | |
| private AppCompatActivity activity; | |
| private final OverlayManager overlayManager; | |
| private final Class activityToBringToFrontOnDetection; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| private Set<ImplicitBroadcastRegistrationLifecycleObserver> getRequiredRegistrators() { | |
| Set<ImplicitBroadcastRegistrationLifecycleObserver> registrators = new HashSet<>(); | |
| registrators.add(new AppInstallationObserver(this)); | |
| ... | |
| return registrators; | |
| } | |
| @Override | |
| public void onCreate() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| apply from: 'lint-checks.gradle' | |
| ... | |
| android { | |
| ... | |
| lintOptions { | |
| textReport true | |
| abortOnError true | |
| warningsAsErrors true |
NewerOlder