forked from flutter/packages
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[quick_actions] Extract the Android implementation into a separate pa…
…ckage (flutter#4698)
- Loading branch information
1 parent
8d3aee5
commit f57546d
Showing
38 changed files
with
808 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Below is a list of people and organizations that have contributed | ||
# to the Flutter project. Names should be added to the list like so: | ||
# | ||
# Name/Organization <email address> | ||
|
||
Google Inc. | ||
The Chromium Authors | ||
German Saprykin <[email protected]> | ||
Benjamin Sauer <[email protected]> | ||
[email protected] | ||
Ali Bitek <[email protected]> | ||
Pol Batlló <[email protected]> | ||
Anatoly Pulyaevskiy | ||
Hayden Flinner <[email protected]> | ||
Stefano Rodriguez <[email protected]> | ||
Salvatore Giordano <[email protected]> | ||
Brian Armstrong <[email protected]> | ||
Paul DeMarco <[email protected]> | ||
Fabricio Nogueira <[email protected]> | ||
Simon Lightfoot <[email protected]> | ||
Ashton Thomas <[email protected]> | ||
Thomas Danner <[email protected]> | ||
Diego Velásquez <[email protected]> | ||
Hajime Nakamura <[email protected]> | ||
Tuyển Vũ Xuân <[email protected]> | ||
Miguel Ruivo <[email protected]> | ||
Sarthak Verma <[email protected]> | ||
Mike Diarmid <[email protected]> | ||
Invertase <[email protected]> | ||
Elliot Hesp <[email protected]> | ||
Vince Varga <[email protected]> | ||
Aawaz Gyawali <[email protected]> | ||
EUI Limited <[email protected]> | ||
Katarina Sheremet <[email protected]> | ||
Thomas Stockx <[email protected]> | ||
Sarbagya Dhaubanjar <[email protected]> | ||
Ozkan Eksi <[email protected]> | ||
Rishab Nayak <[email protected]> | ||
ko2ic <[email protected]> | ||
Jonathan Younger <[email protected]> | ||
Jose Sanchez <[email protected]> | ||
Debkanchan Samadder <[email protected]> | ||
Audrius Karosevicius <[email protected]> | ||
Lukasz Piliszczuk <[email protected]> | ||
SoundReply Solutions GmbH <[email protected]> | ||
Rafal Wachol <[email protected]> | ||
Pau Picas <[email protected]> | ||
Christian Weder <[email protected]> | ||
Alexandru Tuca <[email protected]> | ||
Christian Weder <[email protected]> | ||
Rhodes Davis Jr. <[email protected]> | ||
Luigi Agosti <[email protected]> | ||
Quentin Le Guennec <[email protected]> | ||
Koushik Ravikumar <[email protected]> | ||
Nissim Dsilva <[email protected]> | ||
Giancarlo Rocha <[email protected]> | ||
Ryo Miyake <[email protected]> | ||
Théo Champion <[email protected]> | ||
Kazuki Yamaguchi <[email protected]> | ||
Eitan Schwartz <[email protected]> | ||
Chris Rutkowski <[email protected]> | ||
Juan Alvarez <[email protected]> | ||
Aleksandr Yurkovskiy <[email protected]> | ||
Anton Borries <[email protected]> | ||
Alex Li <[email protected]> | ||
Rahul Raj <[email protected]> | ||
Daniel Roek <[email protected]> | ||
Maurits van Beusekom <[email protected]> |
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,3 @@ | ||
## 0.6.0+9 | ||
|
||
* Switches to a package-internal implementation of the platform interface. |
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,25 @@ | ||
Copyright 2013 The Flutter Authors. All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, | ||
are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above | ||
copyright notice, this list of conditions and the following | ||
disclaimer in the documentation and/or other materials provided | ||
with the distribution. | ||
* Neither the name of Google Inc. nor the names of its | ||
contributors may be used to endorse or promote products derived | ||
from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
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,17 @@ | ||
# quick\_actions\_android | ||
|
||
The Android implementation of [`quick_actions`][1]. | ||
|
||
## Usage | ||
|
||
This package is [endorsed][2], which means you can simply use `quick_actions` | ||
normally. This package will be automatically included in your app when you do. | ||
|
||
## Contributing | ||
|
||
If you would like to contribute to the plugin, check out our [contribution guide][3]. | ||
|
||
[1]: https://pub.dev/packages/quick_actions | ||
[2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin | ||
[3]: https://github.com/flutter/plugins/blob/master/CONTRIBUTING.md | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
8 changes: 8 additions & 0 deletions
8
packages/quick_actions/quick_actions_android/example/README.md
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,8 @@ | ||
# quick_actions_example | ||
|
||
Demonstrates how to use the quick_actions plugin. | ||
|
||
## Getting Started | ||
|
||
For help getting started with Flutter, view our online | ||
[documentation](https://flutter.dev/). |
59 changes: 59 additions & 0 deletions
59
packages/quick_actions/quick_actions_android/example/android/app/build.gradle
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,59 @@ | ||
def localProperties = new Properties() | ||
def localPropertiesFile = rootProject.file('local.properties') | ||
if (localPropertiesFile.exists()) { | ||
localPropertiesFile.withReader('UTF-8') { reader -> | ||
localProperties.load(reader) | ||
} | ||
} | ||
|
||
def flutterRoot = localProperties.getProperty('flutter.sdk') | ||
if (flutterRoot == null) { | ||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") | ||
} | ||
|
||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode') | ||
if (flutterVersionCode == null) { | ||
flutterVersionCode = '1' | ||
} | ||
|
||
def flutterVersionName = localProperties.getProperty('flutter.versionName') | ||
if (flutterVersionName == null) { | ||
flutterVersionName = '1.0' | ||
} | ||
|
||
apply plugin: 'com.android.application' | ||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" | ||
|
||
android { | ||
compileSdkVersion 31 | ||
|
||
lintOptions { | ||
disable 'InvalidPackage' | ||
} | ||
|
||
defaultConfig { | ||
applicationId "io.flutter.plugins.quickactionsexample" | ||
minSdkVersion 21 | ||
targetSdkVersion 28 | ||
versionCode flutterVersionCode.toInteger() | ||
versionName flutterVersionName | ||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
buildTypes { | ||
release { | ||
signingConfig signingConfigs.debug | ||
} | ||
} | ||
} | ||
|
||
flutter { | ||
source '../..' | ||
} | ||
|
||
dependencies { | ||
testImplementation 'junit:junit:4.12' | ||
androidTestImplementation 'androidx.test:runner:1.2.0' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' | ||
api 'androidx.test:core:1.2.0' | ||
} |
5 changes: 5 additions & 0 deletions
5
...ctions/quick_actions_android/example/android/app/gradle/wrapper/gradle-wrapper.properties
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,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
14 changes: 14 additions & 0 deletions
14
...roid/example/android/app/src/androidTest/java/io/flutter/plugins/DartIntegrationTest.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,14 @@ | ||
// 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; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.TYPE) | ||
public @interface DartIntegrationTest {} |
19 changes: 19 additions & 0 deletions
19
.../app/src/androidTest/java/io/flutter/plugins/quickactionsexample/FlutterActivityTest.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,19 @@ | ||
// 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 androidx.test.rule.ActivityTestRule; | ||
import dev.flutter.plugins.integration_test.FlutterTestRunner; | ||
import io.flutter.embedding.android.FlutterActivity; | ||
import io.flutter.plugins.DartIntegrationTest; | ||
import org.junit.Rule; | ||
import org.junit.runner.RunWith; | ||
|
||
@DartIntegrationTest | ||
@RunWith(FlutterTestRunner.class) | ||
public class FlutterActivityTest { | ||
@Rule | ||
public ActivityTestRule<FlutterActivity> rule = new ActivityTestRule<>(FlutterActivity.class); | ||
} |
File renamed without changes.
17 changes: 17 additions & 0 deletions
17
...ges/quick_actions/quick_actions_android/example/android/app/src/debug/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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="io.flutter.plugins.quickactionsexample"> | ||
<!-- Flutter needs internet permission to communicate with the running application | ||
to allow setting breakpoints, to provide hot reload, etc. | ||
--> | ||
<uses-permission android:name="android.permission.INTERNET"/> | ||
<application android:usesCleartextTraffic="true"> | ||
<activity | ||
android:name=".QuickActionsTestActivity" | ||
android:launchMode="singleTop" | ||
android:theme="@style/LaunchTheme" | ||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" | ||
android:hardwareAccelerated="true" | ||
android:windowSoftInputMode="adjustResize"> | ||
</activity> | ||
</application> | ||
</manifest> |
22 changes: 22 additions & 0 deletions
22
...ages/quick_actions/quick_actions_android/example/android/app/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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="io.flutter.plugins.quickactionsexample"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET"/> | ||
|
||
<application android:label="quick_actions_example" android:icon="@mipmap/ic_launcher"> | ||
<meta-data | ||
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame" | ||
android:value="true"/> | ||
<activity android:name="io.flutter.embedding.android.FlutterActivity" | ||
android:theme="@style/LaunchTheme" | ||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection" | ||
android:hardwareAccelerated="true" | ||
android:windowSoftInputMode="adjustResize"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
</activity> | ||
<meta-data android:name="flutterEmbedding" android:value="2"/> | ||
</application> | ||
</manifest> |
20 changes: 20 additions & 0 deletions
20
...id/app/src/main/java/io/flutter/plugins/quickactionsexample/QuickActionsTestActivity.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,20 @@ | ||
// 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 androidx.annotation.NonNull; | ||
import io.flutter.embedding.android.FlutterActivity; | ||
import io.flutter.embedding.engine.FlutterEngine; | ||
|
||
// Makes the FlutterEngine accessible for testing. | ||
public class QuickActionsTestActivity extends FlutterActivity { | ||
public FlutterEngine engine; | ||
|
||
@Override | ||
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { | ||
super.configureFlutterEngine(flutterEngine); | ||
engine = flutterEngine; | ||
} | ||
} |
Oops, something went wrong.