Skip to content

Commit c8d239c

Browse files
Removed unwanted changes
1 parent d792004 commit c8d239c

File tree

134 files changed

+4179
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+4179
-0
lines changed
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#Tue Jul 09 18:11:55 IST 2019
2+
gradle.version=4.10.2
Binary file not shown.

android/.gradle/vcs-1/gc.properties

Whitespace-only changes.

android/app/build.gradle

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
def localProperties = new Properties()
2+
def localPropertiesFile = rootProject.file('local.properties')
3+
if (localPropertiesFile.exists()) {
4+
localPropertiesFile.withReader('UTF-8') { reader ->
5+
localProperties.load(reader)
6+
}
7+
}
8+
9+
def flutterRoot = localProperties.getProperty('flutter.sdk')
10+
if (flutterRoot == null) {
11+
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12+
}
13+
14+
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15+
if (flutterVersionCode == null) {
16+
flutterVersionCode = '1'
17+
}
18+
19+
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20+
if (flutterVersionName == null) {
21+
flutterVersionName = '1.0'
22+
}
23+
24+
apply plugin: 'com.android.application'
25+
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
26+
27+
android {
28+
compileSdkVersion 29
29+
30+
lintOptions {
31+
disable 'InvalidPackage'
32+
}
33+
34+
defaultConfig {
35+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
36+
applicationId "com.syncfusion.flutter_examples"
37+
minSdkVersion 16
38+
targetSdkVersion 29
39+
versionCode flutterVersionCode.toInteger()
40+
versionName flutterVersionName
41+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
42+
}
43+
44+
buildTypes {
45+
release {
46+
// TODO: Add your own signing config for the release build.
47+
// Signing with the debug keys for now, so `flutter run --release` works.
48+
signingConfig signingConfigs.debug
49+
}
50+
}
51+
}
52+
53+
flutter {
54+
source '../..'
55+
}
56+
57+
dependencies {
58+
testImplementation 'junit:junit:4.12'
59+
androidTestImplementation 'com.android.support.test:runner:1.0.2'
60+
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
61+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.syncfusion.flutter_examples">
3+
<!-- Flutter needs it to communicate with the running application
4+
to allow setting breakpoints, to provide hot reload, etc.
5+
-->
6+
<uses-permission android:name="android.permission.INTERNET"/>
7+
</manifest>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.syncfusion.flutter_examples">
3+
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
4+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
5+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"></uses-permission>
6+
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
7+
calls FlutterMain.startInitialization(this); in its onCreate method.
8+
In most cases you can leave this as-is, but you if you want to provide
9+
additional functionality it is fine to subclass or reimplement
10+
FlutterApplication and put your custom class here. -->
11+
<application
12+
android:label="Syncfusion Flutter UI Widgets"
13+
android:icon="@mipmap/ic_launcher">
14+
<meta-data
15+
android:name="flutterEmbedding"
16+
android:value="2" />
17+
<provider
18+
android:name="androidx.core.content.FileProvider"
19+
android:authorities="${applicationId}.fileProvider"
20+
android:exported="false"
21+
android:grantUriPermissions="true">
22+
<meta-data
23+
android:name="android.support.FILE_PROVIDER_PATHS"
24+
android:resource="@xml/provider_path"/>
25+
</provider>
26+
<activity
27+
android:name=".MainActivity"
28+
android:launchMode="singleTop"
29+
android:theme="@style/LaunchTheme"
30+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
31+
android:hardwareAccelerated="true"
32+
android:windowSoftInputMode="adjustResize">
33+
<!-- This keeps the window background of the activity showing
34+
until Flutter renders its first frame. It can be removed if
35+
there is no splash screen (such as the default splash screen
36+
defined in @style/LaunchTheme). -->
37+
<meta-data
38+
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
39+
android:value="true" />
40+
<intent-filter>
41+
<action android:name="android.intent.action.MAIN"/>
42+
<category android:name="android.intent.category.LAUNCHER"/>
43+
</intent-filter>
44+
</activity>
45+
</application>
46+
</manifest>
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
package com.syncfusion.flutter_examples;
2+
3+
import android.Manifest;
4+
import android.content.Intent;
5+
import android.net.Uri;
6+
import android.os.Build;
7+
import android.os.Bundle;
8+
9+
import androidx.core.app.ActivityCompat;
10+
import androidx.core.content.ContextCompat;
11+
import androidx.core.content.FileProvider;
12+
import androidx.core.content.PermissionChecker;
13+
14+
import java.io.File;
15+
16+
import androidx.annotation.NonNull;
17+
import io.flutter.embedding.android.FlutterActivity;
18+
import io.flutter.embedding.engine.FlutterEngine;
19+
import io.flutter.plugin.common.MethodChannel;
20+
import io.flutter.plugins.GeneratedPluginRegistrant;
21+
22+
public class MainActivity extends FlutterActivity {
23+
24+
@Override
25+
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
26+
GeneratedPluginRegistrant.registerWith(flutterEngine);
27+
new MethodChannel(flutterEngine.getDartExecutor().getBinaryMessenger(), "launchFile")
28+
.setMethodCallHandler(
29+
(call, result) -> {
30+
if (call.method.equals("viewPdf") || call.method.equals("viewExcel")) {
31+
String path = call.argument("file_path");
32+
if(!checkPermission(Manifest.permission.READ_EXTERNAL_STORAGE)){
33+
requestPermission(new String[]{Manifest.permission.READ_EXTERNAL_STORAGE});
34+
} else {
35+
launchFile(path);
36+
}
37+
}
38+
}
39+
);
40+
}
41+
private void requestPermission(String[] permission){
42+
ActivityCompat.requestPermissions(this, permission, 1);
43+
}
44+
private boolean checkPermission(String permission) {
45+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
46+
return true;
47+
} else {
48+
if (ContextCompat.checkSelfPermission(this, permission) == PermissionChecker.PERMISSION_GRANTED) {
49+
return true;
50+
} else {
51+
return false;
52+
}
53+
}
54+
}
55+
private void launchFile(String filePath){
56+
File file = new File(filePath);
57+
if(file.exists()){
58+
Intent intent = new Intent(Intent.ACTION_VIEW);
59+
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
60+
intent.addCategory("android.intent.category.DEFAULT");
61+
Uri uri = null;
62+
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
63+
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
64+
String packageName = this.getPackageName();
65+
uri = FileProvider.getUriForFile(this, packageName + ".fileProvider", new File(filePath));
66+
}else {
67+
uri = Uri.fromFile(file);
68+
}
69+
if(filePath.contains(".pdf"))
70+
intent.setDataAndType(uri, "application/pdf");
71+
else
72+
intent.setDataAndType(uri, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
73+
try{
74+
this.startActivity(intent);
75+
}catch (Exception e){
76+
//Could not launch the file.
77+
}
78+
}
79+
}
80+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package io.flutter.plugins;
2+
3+
import io.flutter.plugin.common.PluginRegistry;
4+
import io.flutter.plugins.pathprovider.PathProviderPlugin;
5+
import io.flutter.plugins.urllauncher.UrlLauncherPlugin;
6+
7+
/**
8+
* Generated file. Do not edit.
9+
*/
10+
public final class GeneratedPluginRegistrant {
11+
public static void registerWith(PluginRegistry registry) {
12+
if (alreadyRegisteredWith(registry)) {
13+
return;
14+
}
15+
PathProviderPlugin.registerWith(registry.registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin"));
16+
UrlLauncherPlugin.registerWith(registry.registrarFor("io.flutter.plugins.urllauncher.UrlLauncherPlugin"));
17+
}
18+
19+
private static boolean alreadyRegisteredWith(PluginRegistry registry) {
20+
final String key = GeneratedPluginRegistrant.class.getCanonicalName();
21+
if (registry.hasPlugin(key)) {
22+
return true;
23+
}
24+
registry.registrarFor(key);
25+
return false;
26+
}
27+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Modify this file to customize your launch splash screen -->
3+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4+
<item android:drawable="@android:color/white" />
5+
6+
<!-- You can insert your own image assets here -->
7+
<item>
8+
<bitmap
9+
android:src="@mipmap/launch_image" />
10+
</item>
11+
</layer-list>

0 commit comments

Comments
 (0)