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

Unverified Commit bcc8a326 authored by Marten Gajda's avatar Marten Gajda Committed by GitHub
Browse files

Refactor Light Theme Capter I, implements #879 (#971)

This is an initial redesign and refactoring of the light theme. This also prepares for a future dark theme.
The new theme was separated into a new module so we can share it among modules.
parent 4e96efe9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ android:
    - platform-tools
    - tools
    - build-tools-28.0.3
    - build-tools-29.0.2
    - build-tools-29.0.3
    - android-24
    - android-28
    - android-29
+3 −3
Original line number Diff line number Diff line
@@ -4,9 +4,9 @@ def androidx_test_runner_version = '1.1.1'

ext.deps = [
        // Support & Google libraries
        support_appcompat  : 'androidx.appcompat:appcompat:1.0.2',
        support_annotations: 'androidx.annotation:annotation:1.0.0',
        support_design     : 'com.google.android.material:material:1.0.0',
        support_appcompat  : 'androidx.appcompat:appcompat:1.2.0',
        support_annotations: 'androidx.annotation:annotation:1.1.0',
        support_design     : 'com.google.android.material:material:1.2.1',
        android_dashclock  : 'com.google.android.apps.dashclock:dashclock-api:2.0.0',

        // dmfs
+1 −1
Original line number Diff line number Diff line
COMPILE_SDK_VERSION=29
MIN_SDK_VERSION=19
MIN_SDK_VERSION=21
TARGET_SDK_VERSION=29
VERSION_OVERRIDE=0
android.enableJetifier=true
+1 −0
Original line number Diff line number Diff line
/build
 No newline at end of file
+49 −0
Original line number Diff line number Diff line
/*
 * Copyright 2017 dmfs GmbH
 * Copyright 2021 dmfs GmbH
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -14,47 +14,36 @@
 * limitations under the License.
 */

package org.dmfs.tasks.widget;

import android.view.View;

import org.dmfs.jems.optional.Optional;
import org.dmfs.tasks.R;
plugins {
    id 'com.android.library'
}

android {
    compileSdkVersion COMPILE_SDK_VERSION.toInteger()
    buildToolsVersion "29.0.3"

/**
 * {@link SmartView} adapting any {@link View} so that its background can be updated with a progress in percent,
 * so that it shows the value as a proportionate horizontal overlay.
 *
 * @author Gabor Keszthelyi
 */
public final class ProgressBackgroundView implements SmartView<Optional<Integer>>
{
    private final View mBackgroundView;
    defaultConfig {
        minSdkVersion MIN_SDK_VERSION
        targetSdkVersion TARGET_SDK_VERSION


    public ProgressBackgroundView(View backgroundView)
    {
        mBackgroundView = backgroundView;
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        consumerProguardFiles "consumer-rules.pro"
    }


    @Override
    public void update(Optional<Integer> percentComplete)
    {
        if (percentComplete.isPresent())
        {
            mBackgroundView.setPivotX(0);
            if (percentComplete.value() < 100)
            {
                mBackgroundView.setScaleX(percentComplete.value() / 100f);
                mBackgroundView.setBackgroundResource(R.drawable.task_progress_background_shade);
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
            else
            {
                mBackgroundView.setScaleX(1);
                mBackgroundView.setBackgroundResource(R.drawable.complete_task_background_overlay);
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.2.1'
}
 No newline at end of file
Loading