<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <!-- Permissions -->
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-feature android:name="android.hardware.camera" />
    <uses-feature android:name="android.hardware.camera.autofocus" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <!-- Queries -->
    <queries>
        <!-- To open system camera image capture screen -->
        <intent>
            <action android:name="android.media.action.IMAGE_CAPTURE" />
        </intent>
        <!-- To see if google maps is installed, as it needs a specific intent Uri) -->
        <package android:name="com.google.android.apps.maps" />
    </queries>

    <!-- App -->
    <application
        android:name=".DeRApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        android:hardwareAccelerated="true"
        android:networkSecurityConfig="@xml/network_security_config">
        <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="it.danieleverducci.openweddingapp.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths">
            </meta-data>
        </provider>
        <activity
            android:name=".ui.LoginActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            tools:replace="screenOrientation"
            android:exported="true">
            <!-- Open by launcher -->
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <!-- Open by qrcode -->
            <intent-filter>
                <action android:name="android.intent.action.VIEW"/>

                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.BROWSABLE"/>

                <data android:scheme="http" android:host="mysite.com"/>
                <data android:scheme="https"/>
            </intent-filter>
        </activity>
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            tools:replace="screenOrientation"
            android:exported="true">
        </activity>
        <activity
            android:name=".ShareActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            tools:replace="screenOrientation"
            android:exported="true">
            <!-- Receive single image share intent -->
            <intent-filter>
                <action android:name="android.intent.action.SEND" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="image/*" />
            </intent-filter>
            <!-- Receive multiple images share intent -->
            <intent-filter>
                <action android:name="android.intent.action.SEND_MULTIPLE" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="image/*" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.journeyapps.barcodescanner.CaptureActivity"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            tools:replace="screenOrientation"/>
        <activity
            android:name=".ui.gallery.GalleryFullscreenViewerActivity"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar"
            android:launchMode="singleTask"
            android:screenOrientation="fullSensor"
            tools:replace="screenOrientation"/>
    </application>

</manifest>