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

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
    <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />

    <uses-sdk tools:overrideLibrary="androidx.browser,com.google.firebase.iid"/>
    <application
        android:name="com.github.premnirmal.ticker.StocksApp"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/StocksWidget.App.Theme"
        tools:replace="android:icon">

        <activity
            android:exported="true"
            android:name="com.github.premnirmal.ticker.home.HomeActivity"
            android:launchMode="singleTask"
            android:windowSoftInputMode="adjustPan"
            android:theme="@style/Theme.App.Starting">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                <action android:name="android.intent.action.VIEW" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.github.premnirmal.ticker.portfolio.HoldingsActivity"
            android:label="@string/add_position"
            android:theme="@style/AddPositionTheme"
            android:windowSoftInputMode="adjustResize" />
        <activity
            android:name="com.github.premnirmal.ticker.portfolio.NotesActivity"
            android:label="@string/add_notes"
            android:theme="@style/AddPositionTheme"
            android:windowSoftInputMode="adjustResize" />
        <activity
            android:name="com.github.premnirmal.ticker.portfolio.DisplaynameActivity"
            android:label="@string/add_displayname"
            android:theme="@style/AddPositionTheme"
            android:windowSoftInputMode="adjustResize" />
        <activity
            android:name="com.github.premnirmal.ticker.portfolio.AlertsActivity"
            android:label="@string/add_alerts"
            android:theme="@style/AddPositionTheme"
            android:windowSoftInputMode="adjustResize" />
        <activity
            android:exported="true"
            android:name="com.github.premnirmal.ticker.settings.WidgetSettingsActivity"
            android:label="@string/action_Settings"
            android:theme="@style/WidgetSettingsTheme"
            android:windowSoftInputMode="adjustResize">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
            </intent-filter>
        </activity>

        <activity
            android:name="com.github.premnirmal.ticker.news.QuoteDetailActivity"
            android:label="@string/news_feed"
            android:theme="@style/NewsFeedActivityTheme" />

        <activity
            android:name="com.github.premnirmal.ticker.portfolio.search.SearchActivity"
            android:label="@string/action_search"
            android:theme="@style/SearchTheme" />
        <activity
            android:name="com.github.premnirmal.ticker.settings.WebViewActivity"
            android:theme="@style/WebViewTheme" />
        <activity
            android:name="com.github.premnirmal.ticker.debug.DbViewerActivity"
            android:theme="@style/DbViewerTheme" />

        <receiver
            android:name="com.github.premnirmal.ticker.UpdateReceiver"
            android:enabled="true"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver>
        <receiver
            android:name="com.github.premnirmal.ticker.widget.RefreshReceiver"
            android:enabled="true" />
        <receiver
            android:name="com.github.premnirmal.ticker.notifications.DailySummaryNotificationReceiver"
            android:enabled="true"
            android:exported="false" />

        <!-- Glance Widget -->
        <receiver android:name="com.github.premnirmal.ticker.widget.StockWidget"
            android:exported="true"
            android:label="@string/widget_label">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>
            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/widget" />
        </receiver>

        <!-- File provider -->
        <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="${applicationId}.provider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/provider_paths" />
        </provider>

        <meta-data
            android:name="com.crashlytics.ApiKey"
            android:value="856c59cfad291a9403df034e02e90219acfdedb1" />
    </application>

</manifest>
