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

Commit b57fdd8c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Adding A feature flag to disable widgets and a corresponding build...

Merge "Adding A feature flag to disable widgets  and a corresponding build target Launcher3Go without widgets support" into ub-launcher3-dorval-polish2
parents 05bf5b98 64a75aa3
Loading
Loading
Loading
Loading
+52 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
LOCAL_PATH := $(call my-dir)

#
# Build app code.
# Build rule for Launcher3 app.
#
include $(CLEAR_VARS)

@@ -62,6 +62,57 @@ LOCAL_JACK_COVERAGE_INCLUDE_FILTER := com.android.launcher3.*

include $(BUILD_PACKAGE)

#
# Build rule for Launcher3 Go app for Android Go devices.
#
include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional

LOCAL_STATIC_JAVA_LIBRARIES := \
    android-support-v4 \
    android-support-v7-recyclerview \
    android-support-v7-palette \
    android-support-dynamic-animation

LOCAL_SRC_FILES := \
    $(call all-java-files-under, src) \
    $(call all-java-files-under, src_config) \
    $(call all-java-files-under, go/src_flags) \
    $(call all-proto-files-under, protos) \
    $(call all-proto-files-under, proto_overrides)

LOCAL_RESOURCE_DIR := \
    $(LOCAL_PATH)/go/res \
    $(LOCAL_PATH)/res \
    prebuilts/sdk/current/support/v7/recyclerview/res \

LOCAL_PROGUARD_FLAG_FILES := proguard.flags

LOCAL_PROTOC_OPTIMIZE_TYPE := nano
LOCAL_PROTOC_FLAGS := --proto_path=$(LOCAL_PATH)/protos/ --proto_path=$(LOCAL_PATH)/proto_overrides/
LOCAL_PROTO_JAVA_OUTPUT_PARAMS := enum_style=java

LOCAL_AAPT_FLAGS := \
    --auto-add-overlay \
    --extra-packages android.support.v7.recyclerview \

LOCAL_SDK_VERSION := current
LOCAL_MIN_SDK_VERSION := 21
LOCAL_PACKAGE_NAME := Launcher3Go
LOCAL_PRIVILEGED_MODULE := true
LOCAL_OVERRIDES_PACKAGES := Home Launcher2 Launcher3

LOCAL_FULL_LIBS_MANIFEST_FILES := \
    $(LOCAL_PATH)/AndroidManifest.xml \
    $(LOCAL_PATH)/AndroidManifest-common.xml

LOCAL_MANIFEST_FILE := go/AndroidManifest.xml

LOCAL_JACK_COVERAGE_INCLUDE_FILTER := com.android.launcher3.*

include $(BUILD_PACKAGE)

#
# Launcher proto buffer jar used for development
#
+22 −4
Original line number Diff line number Diff line
@@ -35,11 +35,16 @@ android {
            applicationId 'com.android.launcher3'
            testApplicationId 'com.android.launcher3.tests'
        }

        l3go {
            applicationId 'com.android.launcher3'
            testApplicationId 'com.android.launcher3.tests'
        }
    }
    sourceSets {
        main {
            res.srcDirs = ['res']
            java.srcDirs = ['src', 'src_flags']
            java.srcDirs = ['src']
            manifest.srcFile 'AndroidManifest-common.xml'
            proto {
                srcDir 'protos/'
@@ -48,18 +53,31 @@ android {
        }

        androidTest {
            java.srcDirs = ['tests/src']
            res.srcDirs = ['tests/res']
            java.srcDirs = ['tests/src']
            manifest.srcFile "tests/AndroidManifest-common.xml"
        }

        aosp {
            java.srcDirs = ['src_flags']
            manifest.srcFile "AndroidManifest.xml"
        }

        aospAndroidTest {
            manifest.srcFile "tests/AndroidManifest.xml"
        }

        l3go {
            res.srcDirs = ['go/res']
            java.srcDirs = ['go/src_flags']
            // Note: we are using the Launcher3 manifest here because the gradle manifest-merger uses
            // different attributes than the build system.
            manifest.srcFile "AndroidManifest.xml"
        }

        l3goAndroidTest {
            manifest.srcFile "tests/AndroidManifest.xml"
        }
    }
}

@@ -74,10 +92,10 @@ dependencies {
    compile "com.android.support:support-dynamic-animation:${SUPPORT_LIBS_VERSION}"
    compile "com.android.support:recyclerview-v7:${SUPPORT_LIBS_VERSION}"
    compile "com.android.support:palette-v7:${SUPPORT_LIBS_VERSION}"
    compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-2'
    compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'

    testCompile 'junit:junit:4.12'
    androidTestCompile "org.mockito:mockito-core:1.+"
    androidTestCompile "org.mockito:mockito-core:1.9.5"
    androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
    androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
    androidTestCompile 'com.android.support.test:runner:0.5'

go/AndroidManifest.xml

0 → 100644
+53 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2017, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.android.launcher3" >

    <uses-sdk android:targetSdkVersion="23" android:minSdkVersion="21"/>

    <application
        android:backupAgent="com.android.launcher3.LauncherBackupAgent"
        android:fullBackupOnly="true"
        android:fullBackupContent="@xml/backupscheme"
        android:hardwareAccelerated="true"
        android:icon="@drawable/ic_launcher_home"
        android:label="@string/derived_app_name"
        android:theme="@style/LauncherTheme"
        android:largeHeap="@bool/config_largeHeap"
        android:restoreAnyVersion="true"
        android:supportsRtl="true" >

        <!-- Activity for handling PinItemRequest. Only supports shortcuts -->
        <activity android:name="com.android.launcher3.dragndrop.AddItemActivity"
            android:theme="@android:style/Theme.DeviceDefault.Light.Dialog.Alert"
            android:excludeFromRecents="true"
            android:autoRemoveFromRecents="true"
            android:label="@string/action_add_to_workspace"
            tools:merge="override" >
            <intent-filter>
                <action android:name="android.content.pm.action.CONFIRM_PIN_SHORTCUT" />
            </intent-filter>
        </activity>

    </application>

</manifest>
+66 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingTop="@dimen/widget_preview_label_vertical_padding"
        android:paddingBottom="@dimen/widget_preview_label_vertical_padding"
        android:paddingLeft="@dimen/widget_preview_label_horizontal_padding"
        android:paddingRight="@dimen/widget_preview_label_horizontal_padding"
        android:orientation="horizontal">

        <!-- The name of the widget. -->
        <TextView
            android:id="@+id/widget_name"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:ellipsize="end"
            android:fadingEdge="horizontal"
            android:fontFamily="sans-serif-condensed"
            android:gravity="center"
            android:singleLine="true"
            android:maxLines="1"
            android:textColor="?android:attr/textColorSecondary"
            android:textSize="14sp" />

        <!-- The original dimensions of the widget (can't be the same text as above due to different
             style. -->
        <TextView
            android:id="@+id/widget_dims"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="5dp"
            android:layout_marginLeft="5dp"
            android:visibility="gone"
            android:textColor="?android:attr/textColorSecondary"
            android:textSize="14sp"
            android:fontFamily="sans-serif-condensed"
            android:alpha="0.8" />
    </LinearLayout>

    <!-- The image of the widget. This view does not support padding. Any placement adjustment
         should be done using margins. -->
    <com.android.launcher3.widget.WidgetImageView
        android:id="@+id/widget_preview"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1" />
</merge>
 No newline at end of file
+33 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->

<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

    <!-- Message to tell the user to press and hold on a shortcut to add it [CHAR_LIMIT=50] -->
    <string name="long_press_widget_to_add">Touch &amp; hold to pick up a shortcut.</string>
    <!-- Accessibility spoken hint message in widget picker, which allows user to add a shortcut. Custom action is the label for additional accessibility actions available in this mode [CHAR_LIMIT=100] -->
    <string name="long_accessible_way_to_add">Double-tap &amp; hold to pick up a shortcut or use custom actions.</string>
    <!-- Text for shortcut add button -->
    <string name="widget_button_text">Shortcuts</string>

    <!-- Strings for widgets & more in the popup container/bottom sheet -->
    <!-- Title for a bottom sheet that shows shortcuts for a particular app -->
    <string name="widgets_bottom_sheet_title"><xliff:g id="name" example="Messenger">%1$s</xliff:g> shortcuts</string>

</resources>
Loading