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

Commit 97b51f18 authored by Romain Hunault's avatar Romain Hunault 🚴🏻
Browse files

Merge branch 'improvement/ui' into 'master'

Fix title and add back navigation support

See merge request e/privacy-central/privacycentralapp!5
parents 7c02e9a0 fafd9783
Loading
Loading
Loading
Loading
Loading

.sign/platform.jks

0 → 100644
+2.83 KiB

File added.

No diff preview for this file type.

+93 −61
Original line number Diff line number Diff line
@@ -18,8 +18,25 @@ android {
        resValue("string", "mapbox_key", MAPBOX_KEY)
    }

    signingConfigs {
        debug {
            storeFile rootProject.file(".sign/debug.keystore")
            storePassword "android"
            keyAlias "androiddebugkey"
            keyPassword "android"
        }

        // We use test platform keys to sign /e/OS specific debug flavour.
        eDebug {
            storeFile rootProject.file(".sign/platform.jks")
            storePassword "android"
            keyAlias "platform"
            keyPassword "android"
        }
    }

    // We define here  the OS flavor e, specific for the /e/ OS version, and google, for any
	// Andriod device. The e or google prefix is then used in resources, dependencies, ... as
    // android device. The e or google prefix is then used in resources, dependencies, ... as
    // expected by the android gradle plugin.
    flavorDimensions 'os'
    productFlavors {
@@ -34,18 +51,28 @@ android {
    }

    buildTypes {
        debug {
            signingConfig null  // Set signing config to null as we use signingConfig per variant.
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

	signingConfigs {
		debug {
			storeFile rootProject.file(".sign/debug.keystore")
			storePassword "android"
			keyAlias "androiddebugkey"
			keyPassword "android"
    /**
     * Sets the output name of the variant outputs and also it setup signingConfig based on the product flavor.
     */
    applicationVariants.all { variant ->
        if (variant.buildType.name == "debug") {
            variant.outputs.all { output ->
                outputFileName = "PrivacyCentral-${output.name}-${variant.versionName}.apk"
            }
            if (variant.getFlavorName() == "e") {
                variant.mergedFlavor.signingConfig = signingConfigs.eDebug
            } else {
                variant.mergedFlavor.signingConfig = signingConfigs.debug
            }
        }
    }

@@ -56,6 +83,7 @@ android {
}

dependencies {
    compileOnly files('libs/e-ui-sdk-1.0.1-q.jar')
    implementation project(":privacymodulesapi")

    // include the google specific version of the modules, just for the google flavor
@@ -71,9 +99,13 @@ dependencies {
    implementation Libs.AndroidX.Lifecycle.viewmodel

    implementation Libs.MapBox.sdk
	implementation 'com.google.android.material:material:1.3.0'
    implementation 'com.google.android.material:material:1.4.0-beta01'

    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

static def log(Object val) {
    println("[GradleRepository]: " + val)
}
+113 KiB

File added.

No diff preview for this file type.

+34 −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.common

import androidx.annotation.LayoutRes
import com.google.android.material.appbar.MaterialToolbar

abstract class NavToolbarFragment(@LayoutRes contentLayoutId: Int) : ToolbarFragment(contentLayoutId) {

    override fun setupToolbar(toolbar: MaterialToolbar) {
        super.setupToolbar(toolbar)
        toolbar.apply {
            setNavigationIcon(lineageos.platform.R.drawable.ic_back)
            setNavigationOnClickListener {
                requireActivity().onBackPressed()
            }
        }
    }
}
+43 −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.common

import android.os.Bundle
import android.view.View
import androidx.annotation.LayoutRes
import androidx.fragment.app.Fragment
import com.google.android.material.appbar.MaterialToolbar
import foundation.e.privacycentralapp.R

abstract class ToolbarFragment(@LayoutRes contentLayoutId: Int) : Fragment(contentLayoutId) {

    /**
     * @return title to be used in toolbar
     */
    abstract fun getTitle(): String

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)

        setupToolbar(view.findViewById(R.id.toolbar))
    }

    open fun setupToolbar(toolbar: MaterialToolbar) {
        toolbar.title = getTitle()
    }
}
Loading