Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
241eadc
initial commit
bparrishMines Apr 25, 2023
8619800
attempt to get plugin ready for CI
bparrishMines Apr 25, 2023
7ebaa32
formatting
bparrishMines Apr 25, 2023
a7f88ad
analyzer errors
bparrishMines Apr 25, 2023
7ad4d46
Merge branch 'main' of github.com:flutter/packages into file_selector…
bparrishMines Apr 25, 2023
40a6178
dep order
bparrishMines Apr 25, 2023
25f36b1
example dep order
bparrishMines Apr 25, 2023
87179de
fix readme
bparrishMines Apr 25, 2023
ba934f9
add dependabot
bparrishMines Apr 25, 2023
0dbdc12
Merge branch 'main' of github.com:flutter/packages into file_selector…
bparrishMines Apr 25, 2023
13f55ee
namespace
bparrishMines Apr 25, 2023
1f28c7d
cameraMerge branch 'main' of github.com:flutter/packages into file_se…
bparrishMines May 8, 2023
017ed72
implement pigeon files
bparrishMines May 8, 2023
fe605c0
change namespace
bparrishMines May 8, 2023
0fec82b
dart side of impl
bparrishMines May 9, 2023
f179ab0
java side impl of pigeon api
bparrishMines May 9, 2023
1002bc3
implement something
bparrishMines May 9, 2023
32c440b
running example
bparrishMines May 9, 2023
f45cc08
dart side of new impl
bparrishMines May 11, 2023
2adae90
capture current state
bparrishMines May 11, 2023
b49eab6
formatting
bparrishMines May 16, 2023
a513192
Merge branch 'main' of github.com:flutter/packages into file_selector…
bparrishMines May 16, 2023
9cd2774
working code i guess
bparrishMines May 16, 2023
b8aae60
handle opening multiple files
bparrishMines May 16, 2023
6c92c72
finish handling opening images
bparrishMines May 16, 2023
82a6c79
java side of handling get dirs
bparrishMines May 16, 2023
7725cc5
remove get dirs
bparrishMines May 16, 2023
a6a4066
remove test context
bparrishMines May 16, 2023
6d7a340
some improvements to readablity
bparrishMines May 17, 2023
750e588
finish dart side tests
bparrishMines May 17, 2023
0e5e416
open file test
bparrishMines May 18, 2023
1b08e94
formatting
bparrishMines May 18, 2023
56dcdd8
update helper method
bparrishMines May 18, 2023
be9dcc8
open files test
bparrishMines May 18, 2023
4e6c548
use a set instead
bparrishMines May 18, 2023
407a118
formatting
bparrishMines May 18, 2023
fb8485b
add placeholder integration test
bparrishMines May 18, 2023
b165ed4
update pubspec
bparrishMines May 18, 2023
2673f12
Merge branch 'main' of github.com:flutter/packages into file_selector…
bparrishMines May 18, 2023
c5643ae
conditionalize namespace
bparrishMines May 18, 2023
d25a689
lint fixes
bparrishMines May 18, 2023
6ae37e6
fix integration test import
bparrishMines May 18, 2023
20c55f8
formatting
bparrishMines May 18, 2023
12070b6
handle null toFileResponse
bparrishMines May 18, 2023
9498a56
Merge branch 'main' of github.com:flutter/packages into file_selector…
bparrishMines May 24, 2023
a99550a
dart side of pigeon updates
bparrishMines May 25, 2023
0942fb8
fix dart todo
bparrishMines May 25, 2023
f3b07c8
update java side
bparrishMines May 25, 2023
33c3801
formatting and java side
bparrishMines May 25, 2023
21419de
method for typegroups
bparrishMines May 26, 2023
8dfc2b1
comment
bparrishMines May 31, 2023
882acb7
using the binding instead
bparrishMines May 31, 2023
e351b7a
Merge branch 'main' of github.com:flutter/packages into file_selector…
bparrishMines May 31, 2023
dc85a97
bump mockito and clarify launch test
bparrishMines Jun 7, 2023
b809399
running integration test
bparrishMines Jun 13, 2023
f83d6f3
formatting and the other files
bparrishMines Jun 13, 2023
e84c565
Merge branch 'main' of github.com:flutter/packages into file_selector…
bparrishMines Jun 13, 2023
6074461
working integration test
bparrishMines Jun 13, 2023
d667d8a
integration test files
bparrishMines Jun 13, 2023
2b72838
running tests
bparrishMines Jun 13, 2023
9827799
license
bparrishMines Jun 13, 2023
fff7692
authors
bparrishMines Jun 13, 2023
245336d
some small fixes
bparrishMines Jun 13, 2023
0ceef57
use manifest instead maybe
bparrishMines Jun 13, 2023
563e570
add entry point
bparrishMines Jun 14, 2023
66b32aa
add integrationTestMain to integration test
bparrishMines Jun 14, 2023
791c67e
fix activity test rule
bparrishMines Jun 14, 2023
7d50a42
formatting
bparrishMines Jun 14, 2023
443e4c8
Merge branch 'main' of github.com:flutter/packages into file_selector…
bparrishMines Jun 14, 2023
776a771
Merge branch 'main' of github.com:flutter/packages into file_selector…
bparrishMines Jun 15, 2023
b85e1a7
Merge branch 'main' of github.com:flutter/packages into file_selector…
bparrishMines Jun 26, 2023
018aa30
small review fixes
bparrishMines Jun 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,34 @@ updates:
- dependency-name: "*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]

- package-ecosystem: "gradle"
directory: "/packages/file_selector/file_selector_android/android"
commit-message:
prefix: "[file_selector]"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "com.android.tools.build:gradle"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: "junit:junit"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: "org.mockito:*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: "androidx.test:*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]

- package-ecosystem: "gradle"
directory: "/packages/file_selector/file_selector_android/example/android/app"
commit-message:
prefix: "[file_selector]"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]

- package-ecosystem: "gradle"
directory: "/packages/flutter_adaptive_scaffold/example/android/app"
commit-message:
Expand Down
6 changes: 6 additions & 0 deletions packages/file_selector/file_selector_android/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# 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.
3 changes: 3 additions & 0 deletions packages/file_selector/file_selector_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.5.0

* Implements file_selector_platform_interface for Android.
25 changes: 25 additions & 0 deletions packages/file_selector/file_selector_android/LICENSE
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.
15 changes: 15 additions & 0 deletions packages/file_selector/file_selector_android/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# file\_selector\_android

The Android implementation of [`file_selector`][1].

## Usage

This package is [endorsed][2], which means you can simply use `file_selector`
normally. This package will be automatically included in your app when you do,
so you do not need to add it to your `pubspec.yaml`.

However, if you `import` this package to use any of its APIs directly, you
should add it to your `pubspec.yaml` as usual.

[1]: https://pub.dev/packages/file_selector
[2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
group 'dev.flutter.packages.file_selector_android'
version '1.0'

buildscript {
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
}
}

rootProject.allprojects {
repositories {
google()
mavenCentral()
}
}

apply plugin: 'com.android.library'

android {
// Conditional for compatibility with AGP <4.2.
if (project.android.hasProperty("namespace")) {
namespace 'dev.flutter.packages.file_selector_android'
}
compileSdkVersion 33

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
minSdkVersion 19
}

dependencies {
implementation 'androidx.annotation:annotation:1.5.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-inline:5.1.0'
testImplementation 'androidx.test:core:1.3.0'
}

lintOptions {
checkAllWarnings true
warningsAsErrors true
disable 'AndroidGradlePluginVersion', 'InvalidPackage', 'GradleDependency'
}

testOptions {
unitTests.includeAndroidResources = true
unitTests.returnDefaultValues = true
unitTests.all {
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
outputs.upToDateWhen {false}
showStandardStreams = true
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = 'file_selector_android'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="dev.flutter.packages.file_selector_android">
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// 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 dev.flutter.packages.file_selector_android;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.embedding.engine.plugins.activity.ActivityAware;
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;

/** Native portion of the Android platform implementation of the file_selector plugin. */
public class FileSelectorAndroidPlugin implements FlutterPlugin, ActivityAware {
@Nullable private FileSelectorApiImpl fileSelectorApi;
private FlutterPluginBinding pluginBinding;

@Override
public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) {
pluginBinding = binding;
}

@Override
public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
pluginBinding = null;
}

@Override
public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) {
fileSelectorApi = new FileSelectorApiImpl(binding);
GeneratedFileSelectorApi.FileSelectorApi.setup(
pluginBinding.getBinaryMessenger(), fileSelectorApi);
}

@Override
public void onDetachedFromActivityForConfigChanges() {
if (fileSelectorApi != null) {
fileSelectorApi.setActivityPluginBinding(null);
}
}

@Override
public void onReattachedToActivityForConfigChanges(@NonNull ActivityPluginBinding binding) {
if (fileSelectorApi != null) {
fileSelectorApi.setActivityPluginBinding(binding);
} else {
fileSelectorApi = new FileSelectorApiImpl(binding);
GeneratedFileSelectorApi.FileSelectorApi.setup(
pluginBinding.getBinaryMessenger(), fileSelectorApi);
}
}

@Override
public void onDetachedFromActivity() {
if (fileSelectorApi != null) {
fileSelectorApi.setActivityPluginBinding(null);
}
}
}
Loading