Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c821494c authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

AM: Add navigation bar changes in Account Manager

parent 6d41fb27
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -227,6 +227,29 @@
                    android:resource="@xml/e_sync_e_notes" />
        </service>

        <activity
                android:name="foundation.e.accountmanager.ui.PrivacyPolicyActivity"
                android:theme="@style/Theme.AppCompat.DayNight.NoActionBar" />

        <activity-alias
                android:name=".PrivacyPolicy"
                android:exported="true"
                android:process=":ui"
                android:targetActivity="foundation.e.accountmanager.ui.PrivacyPolicyActivity">
            <intent-filter>
                <action android:name="com.android.settings.action.EXTRA_SETTINGS" />
            </intent-filter>
            <meta-data
                    android:name="com.android.settings.category"
                    android:value="com.android.settings.category.ia.accounts" />
            <meta-data
                    android:name="com.android.settings.title"
                    android:resource="@string/privacy_policy_title" />
            <meta-data
                    android:name="com.android.settings.order"
                    android:value="205" />
        </activity-alias>

        <!-- endregion /e/ Specific -->

    </application>
+25 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
package at.bitfire.davdroid.ui

import android.content.ActivityNotFoundException
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import androidx.annotation.StringRes
@@ -21,8 +22,10 @@ import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.EditCalendar
import androidx.compose.material.icons.filled.Feedback
import androidx.compose.material.icons.filled.Info
import androidx.compose.material.icons.filled.Policy
import androidx.compose.material.icons.filled.Settings
import androidx.compose.material.icons.filled.Storage
import androidx.compose.material3.HorizontalDivider
@@ -56,6 +59,8 @@ import at.bitfire.davdroid.R
import at.bitfire.davdroid.ui.about.AboutActivity
import at.bitfire.davdroid.ui.composable.AppTheme
import at.bitfire.davdroid.ui.webdav.WebdavMountsActivity
import foundation.e.accountmanager.ui.PrivacyPolicyActivity
import foundation.e.accountmanager.utils.AppConstants
import kotlinx.coroutines.launch
import java.net.URI

@@ -124,6 +129,14 @@ abstract class AccountsDrawerHandler {
            }
        )

        MenuEntry(
            icon = Icons.Default.Policy,
            title = stringResource(R.string.privacy_policy_title_nav),
            onClick = {
                context.startActivity(Intent(context, PrivacyPolicyActivity::class.java))
            }
        )

        if (isBeta)
            MenuEntry(
                icon = Icons.Default.Feedback,
@@ -162,6 +175,18 @@ abstract class AccountsDrawerHandler {
                context.startActivity(Intent(context, WebdavMountsActivity::class.java))
            }
        )
        MenuEntry(
            icon = Icons.Default.EditCalendar,
            title = stringResource(R.string.navigation_drawer_open_webcalmanager),
            onClick = {
                val intent = Intent(Intent.ACTION_MAIN)
                intent.component = ComponentName(
                    AppConstants.WEBCAL_MANAGER_PACKAGE,
                    AppConstants.WEBCAL_MANAGER_ACTIVITY
                )
                context.startActivity(intent)
            }
        )
    }


+6 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ open class OseAccountsDrawerHandler @Inject constructor(): AccountsDrawerHandler
        ImportantEntries(snackbarHostState)

        // News
        /*
        MenuHeading(R.string.navigation_drawer_news_updates)
        MenuEntry(
            icon = painterResource(R.drawable.mastodon),
@@ -47,11 +48,13 @@ open class OseAccountsDrawerHandler @Inject constructor(): AccountsDrawerHandler
                uriHandler.openUri(Social.fediverseUrl.toString())
            }
        )
        */

        // Tools
        Tools()

        // Support the project
        /*
        MenuHeading(R.string.navigation_drawer_support_project)
        Contribute(onContribute = {
            uriHandler.openUri(
@@ -68,9 +71,11 @@ open class OseAccountsDrawerHandler @Inject constructor(): AccountsDrawerHandler
                uriHandler.openUri(Social.discussionsUrl.toString())
            }
        )
        */


        // External links
        /*
        MenuHeading(R.string.navigation_drawer_external_links)
        MenuEntry(
            icon = Icons.Default.Home,
@@ -127,6 +132,7 @@ open class OseAccountsDrawerHandler @Inject constructor(): AccountsDrawerHandler
                )
            }
        )
        */
    }

    @Composable
+32 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 eFoundation
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
 *
 */
package foundation.e.accountmanager.ui

import android.os.Bundle
import androidx.activity.ComponentActivity
import foundation.e.accountmanager.utils.AppConstants
import foundation.e.accountmanager.utils.WebViewUtils


class PrivacyPolicyActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        WebViewUtils.openCustomTab(this, AppConstants.PRIVACY_POLICY_URL)
        finishAfterTransition() // Finish the activity after launching the custom tab
    }
}
+24 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 eFoundation
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
 *
 */
package foundation.e.accountmanager.utils

object AppConstants {
    const val WEBCAL_MANAGER_PACKAGE = "foundation.e.webcalendarmanager"
    const val WEBCAL_MANAGER_ACTIVITY = "at.bitfire.icsdroid.ui.views.CalendarListActivity"
    const val PRIVACY_POLICY_URL = "https://e.foundation/legal-notice-privacy/#account-manager"
}
Loading