This repository was archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Android native test for QuickActionsPlugin
- Loading branch information
Showing
8 changed files
with
212 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
8 changes: 5 additions & 3 deletions
8
packages/quick_actions/quick_actions_android/android/src/main/AndroidManifest.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
package="io.flutter.plugins.quickactions"> | ||
<manifest | ||
xmlns:tools="http://schemas.android.com/tools" | ||
package="io.flutter.plugins.quickactions"> | ||
|
||
<uses-sdk tools:overrideLibrary="android_libs.ub_uiautomator"/> | ||
</manifest> |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
48 changes: 48 additions & 0 deletions
48
...ple/android/app/src/androidTest/java/io/flutter/plugins/quickactionsexample/Shortcut.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. | ||
|
||
package io.flutter.plugins.quickactionsexample; | ||
|
||
import android.content.pm.ShortcutInfo; | ||
import java.util.Objects; | ||
|
||
class Shortcut { | ||
final String type; | ||
final String shortLabel; | ||
final String longLabel; | ||
String icon; | ||
|
||
public Shortcut(ShortcutInfo shortcutInfo) { | ||
this.type = shortcutInfo.getId(); | ||
this.shortLabel = shortcutInfo.getShortLabel().toString(); | ||
this.longLabel = shortcutInfo.getLongLabel().toString(); | ||
} | ||
|
||
public Shortcut(String type, String shortLabel, String longLabel) { | ||
this.type = type; | ||
this.shortLabel = shortLabel; | ||
this.longLabel = longLabel; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
|
||
Shortcut shortcut = (Shortcut) o; | ||
|
||
if (!type.equals(shortcut.type)) return false; | ||
if (!shortLabel.equals(shortcut.shortLabel)) return false; | ||
if (!longLabel.equals(shortcut.longLabel)) return false; | ||
return Objects.equals(icon, shortcut.icon); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
int result = type.hashCode(); | ||
result = 31 * result + shortLabel.hashCode(); | ||
result = 31 * result + longLabel.hashCode(); | ||
result = 31 * result + (icon != null ? icon.hashCode() : 0); | ||
return result; | ||
} | ||
} |