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

Commit 9035bac3 authored by Guillaume Jacquart's avatar Guillaume Jacquart
Browse files

Update dashboard UI and feature

parent c7f46a5d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'kotlin-kapt'
}

android {
@@ -84,6 +85,10 @@ android {
    aaptOptions {
        additionalParameters '-I', 'app/libs/e-ui-sdk-1.0.1-q.jar'
    }

    buildFeatures {
        dataBinding true
    }
}

dependencies {
+16 −0
Original line number Diff line number Diff line
@@ -20,6 +20,9 @@ package foundation.e.privacycentralapp
import android.app.Application
import android.content.Context
import android.os.Process
import foundation.e.privacycentralapp.data.repositories.LocalStateRepository
import foundation.e.privacycentralapp.domain.usecases.GetQuickPrivacyStateUseCase
import foundation.e.privacycentralapp.features.dashboard.DashBoardViewModelFactory
import foundation.e.privacycentralapp.features.internetprivacy.InternetPrivacyViewModelFactory
import foundation.e.privacycentralapp.features.location.FakeLocationViewModelFactory
import foundation.e.privacycentralapp.features.location.LocationApiDelegate
@@ -40,6 +43,7 @@ class DependencyContainer constructor(val app: Application) {

    val context: Context by lazy { app.applicationContext }

    // Drivers
    private val fakeLocationModule: IFakeLocation by lazy { FakeLocation(app.applicationContext) }
    private val permissionsModule by lazy { PermissionsPrivacyModule(app.applicationContext) }
    private val ipScramblerModule: IIpScramblerModule by lazy { IpScramblerModule(app.applicationContext) }
@@ -57,6 +61,18 @@ class DependencyContainer constructor(val app: Application) {
        LocationApiDelegate(fakeLocationModule, permissionsModule, appDesc)
    }

    // Repositories
    private val localStateRepository by lazy { LocalStateRepository(context) }

    // Usecases
    private val getQuickPrivacyStateUseCase by lazy {
        GetQuickPrivacyStateUseCase(localStateRepository)
    }

    val dashBoardViewModelFactory by lazy {
        DashBoardViewModelFactory(getQuickPrivacyStateUseCase)
    }

    val fakeLocationViewModelFactory by lazy {
        FakeLocationViewModelFactory(locationApi)
    }
+2 −5
Original line number Diff line number Diff line
@@ -31,10 +31,7 @@ class LocalStateRepository(context: Context) {
        get() = sharedPref.getBoolean(KEY_QUICK_PRIVACY, false)
        set(value) = set(KEY_QUICK_PRIVACY, value)


    private fun set(key: String, value: Boolean) {
        sharedPref.edit().putBoolean(key, value).apply()
        sharedPref.edit().putBoolean(key, value).commit()
    }


}
+22 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 E FOUNDATION
 *
 * 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.privacycentralapp.domain.entities

enum class InternetPrivacyMode {
    REAL_IP, HIDE_IP
}
+22 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 E FOUNDATION
 *
 * 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.privacycentralapp.domain.entities

enum class LocationMode {
    REAL_LOCATION, RANDOM_LOCATION, CUSTOM_LOCATION
}
Loading