Skip to content

Commit

Permalink
Added support to mock camera and image picker (#22)
Browse files Browse the repository at this point in the history
added support mock camera and image picker for android
  • Loading branch information
saikrishna321 authored Jul 19, 2024
1 parent 7eb7db4 commit e2b5b1c
Show file tree
Hide file tree
Showing 20 changed files with 1,515 additions and 15 deletions.
5 changes: 5 additions & 0 deletions demo-app/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
</manifest>
7 changes: 7 additions & 0 deletions demo-app/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
Expand All @@ -9,6 +15,7 @@
<application
android:label="appium_testing_app"
android:name="${applicationName}"
android:requestLegacyExternalStorage="true"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
Expand Down
4 changes: 4 additions & 0 deletions demo-app/android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.CAMERA" />

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
6 changes: 6 additions & 0 deletions demo-app/lib/screens/home_screen.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:appium_testing_app/components/custom_app_bar.dart';
import 'package:appium_testing_app/models/feature_model.dart';
import 'package:appium_testing_app/screens/image_picker.dart';
import 'package:appium_testing_app/screens/lazy_loading.dart';
import 'package:appium_testing_app/screens/loader_screen.dart';
import 'package:appium_testing_app/screens/native_screen.dart';
Expand Down Expand Up @@ -63,6 +64,8 @@ class _HomeScreenState extends State<HomeScreen> {
title: "Loader Screen", subtitle: "Page with loader and a button"));
featureModels.add(FeatureModel(
title: "Contact permission", subtitle: "Asks for contact permission with native popup"));
featureModels.add(FeatureModel(
title: "Image Picker", subtitle: "Mock Camera Image Picker"));
}

@override
Expand Down Expand Up @@ -153,6 +156,9 @@ class _HomeScreenState extends State<HomeScreen> {
case 14:
page = ContactPermissionScreen(title: featureModels[index].title,);
break;
case 15:
page = ImagePickerScreen(title: featureModels[index].title,);
break;
default:
page = NativeScreen(title: featureModels[index].title);
break;
Expand Down
Loading

0 comments on commit e2b5b1c

Please sign in to comment.