Merge pull request #6180 from nextcloud/dependabot/gradle/com.android.tools.build-gradle-4.0.0

Bump gradle from 3.6.3 to 4.0.0
This commit is contained in:
Andy Scherzinger 2020-06-19 12:23:56 +02:00 committed by GitHub
commit fb1bb6905c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 134 additions and 101 deletions

View file

@ -388,7 +388,7 @@ steps:
- sed -i "/qa/,/\}/ s/versionCode .*/versionCode $DRONE_BUILD_NUMBER/" build.gradle
- sed -i "/qa/,/\}/ s/versionName .*/versionName \"$DRONE_BUILD_NUMBER\"/" build.gradle
- ./gradlew assembleQaDebug
- /opt/android-sdk-linux/build-tools/*/apksigner sign --ks-pass pass:$KS_PASS --key-pass pass:$KEY_PASS --ks-key-alias key0 --ks scripts/QA_keystore.jks build/outputs/apk/qa/debug/qa-debug-*.apk
- $(find /opt/android-sdk-linux/build-tools/*/apksigner | sort | tail -n1) sign --ks-pass pass:$KS_PASS --key-pass pass:$KEY_PASS --ks-key-alias key0 --ks scripts/QA_keystore.jks build/outputs/apk/qa/debug/qa-debug-*.apk
- scripts/uploadArtifact.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
trigger:

View file

@ -16,7 +16,7 @@ jobs:
with:
java-version: 1.8
- name: Install NDK
run: echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;20.0.5594570" --sdk_root=${ANDROID_SDK_ROOT}
run: echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;21.0.6113669" --sdk_root=${ANDROID_SDK_ROOT}
- name: Build with Gradle
run: |
mkdir -p $HOME/.gradle

View file

@ -16,7 +16,7 @@ jobs:
with:
java-version: 1.8
- name: Install NDK
run: echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;20.0.5594570" --sdk_root=${ANDROID_SDK_ROOT}
run: echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;21.0.6113669" --sdk_root=${ANDROID_SDK_ROOT}
- name: Build generic
run: |
mkdir -p $HOME/.gradle

View file

@ -1,10 +1,11 @@
import com.github.spotbugs.snom.SpotBugsTask
// Gradle build file
//
// This project was started in Eclipse and later moved to Android Studio. In the transition, both IDEs were supported.
// Due to this, the files layout is not the usual in new projects created with Android Studio / gradle. This file
// merges declarations usually split in two separates build.gradle file, one for global settings of the project in
// its root folder, another one for the app module in subfolder of root.
import com.github.spotbugs.SpotBugsTask
buildscript {
ext.kotlin_version = '1.3.72'
@ -20,11 +21,9 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath('com.dicedmelon.gradle:jacoco-android:0.1.4') {
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
}
classpath 'gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:1.6.6'
classpath 'com.android.tools.build:gradle:4.0.0'
classpath('com.hiya:jacoco-android:0.2')
classpath 'gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.9.1"
classpath "commons-httpclient:commons-httpclient:3.1@jar" // remove after entire switch to lib v2
@ -39,7 +38,7 @@ apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'checkstyle'
apply plugin: 'pmd'
apply plugin: 'jacoco-android'
apply plugin: 'com.hiya.jacoco-android'
apply plugin: 'com.github.spotbugs'
apply plugin: 'io.gitlab.arturbosch.detekt'
apply plugin: 'shot'
@ -51,7 +50,7 @@ configurations {
exclude group: 'com.google.firebase', module: 'firebase-core'
exclude group: 'com.google.firebase', module: 'firebase-analytics'
exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
exclude group: 'org.jetbrains', module: 'annotations-java5' // via prism4j, already using annotations explicitely
exclude group: 'org.jetbrains', module: 'annotations-java5' // via prism4j, already using annotations explicitly
// check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
@ -67,8 +66,8 @@ ext {
travisBuild = System.getenv("TRAVIS") == "true"
// allows for -Dpre-dex=false to be set
preDexEnabled = "true".equals(System.getProperty("pre-dex", "true"))
// allows for -D pre-dex=false to be set
preDexEnabled = "true" == System.getProperty("pre-dex", "true")
}
repositories {
@ -99,9 +98,7 @@ for (TaskExecutionRequest tr : getGradle().getStartParameter().getTaskRequests()
}
}
spotbugs {
toolVersion = '3.1.12'
}
android {
lintOptions {
@ -196,7 +193,7 @@ android {
// see http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Configuring-the-Structure
dexOptions {
// Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
// Skip pre-dexing when running on Travis CI or when disabled via -D pre-dex=false.
preDexLibraries = preDexEnabled && !travisBuild
}
@ -238,41 +235,33 @@ android {
android.applicationVariants.all { variant ->
String variantName = variant.name
String capVariantName = variantName.substring(0, 1).toUpperCase() + variantName.substring(1)
tasks.register("spotbugs${capVariantName}", SpotBugsTask) {
tasks.register("spotbugs${capVariantName}Report", SpotBugsTask) {
ignoreFailures = true // should continue checking
effort = "max"
reportLevel = "medium"
classes = fileTree("$project.buildDir/intermediates/javac/${variantName}/classes/")
excludeFilter = file("${project.rootDir}/spotbugs-filter.xml")
pluginClasspath = project.configurations.spotbugsPlugins
source = fileTree('src/main/java')
classpath = files()
include '**/*.java'
exclude '**/gen/**'
reports {
xml.enabled = false
html.enabled = true
html {
enabled = true
destination = file("$project.buildDir/reports/spotbugs/spotbugs.html")
}
}
}
}
check.dependsOn 'checkstyle', 'spotbugsGplayDebug', 'pmd', 'lint', 'ktlint', 'detekt'
check.dependsOn 'checkstyle', 'spotbugsGplayDebugReport', 'pmd', 'lint', 'ktlint', 'detekt'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dataBinding {
enabled true
}
viewBinding {
enabled true
buildFeatures {
dataBinding true
viewBinding true
}
}
@ -423,17 +412,15 @@ android.applicationVariants.all { variant ->
tasks.register("combinedTestReport", JacocoReport) {
reports {
xml.enabled = true
html.enabled = true
xml.enabled true
html.enabled true
csv.enabled false
}
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
def debugTree = fileTree(dir: "$project.buildDir/intermediates/classes/gplay/debug", excludes: fileFilter)
def mainSrc = "$project.projectDir/src/main/java"
sourceDirectories = files([mainSrc])
classDirectories = files([debugTree])
executionData = fileTree(dir: project.buildDir, includes: [
additionalSourceDirs.setFrom files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories.setFrom files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories.setFrom files(subprojects.sourceSets.main.output)
executionData.setFrom project.fileTree(dir: project.buildDir, includes: [
'jacoco/testGplayDebugUnitTest.exec', 'outputs/code-coverage/connected/flavors/GPLAY/*coverage.ec'
])
}

View file

@ -1,6 +1,6 @@
#Wed Aug 21 07:03:37 CEST 2019
#Fri May 29 07:39:21 CEST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

View file

@ -1 +1 @@
373
367

View file

@ -56,7 +56,7 @@ if result != 0
exit 1
end
system './gradlew spotbugsGplayDebug'
system './gradlew spotbugsGplayDebugReport'
# find FindBugs report file
findbugs_reports = Dir.glob(FINDBUGS_REPORT_FILE)

View file

@ -1,2 +1,2 @@
DO NOT TOUCH; GENERATED BY DRONE
<span class="mdl-layout-title">Lint Report: 94 warnings</span>
<span class="mdl-layout-title">Lint Report: 92 warnings</span>

View file

@ -8,8 +8,15 @@ upload() {
echo "Uploaded failing tests to https://www.kaminsky.me/nc-dev/android-integrationTests/$REMOTE_FOLDER"
# delete all old comments, matching this type
oldComments=$(curl 2>/dev/null -u $GITHUB_USER:$GITHUB_PASSWORD -X GET https://api.github.com/repos/nextcloud/android/issues/$PR/comments | jq --arg type $BRANCH_TYPE '.[] | (.id |tostring) + "|" + (.user.login | test("nextcloud-android-bot") | tostring) + "|" + (.body | test("[$TYPE] test failed.*") | tostring)'| grep "true|true" | tr -d "\"" | cut -f1 -d"|")
echo $oldComments | while read comment ; do
curl 2>/dev/null -u $GITHUB_USER:$GITHUB_PASSWORD -X DELETE https://api.github.com/repos/nextcloud/android/issues/comments/$comment
done
curl -u $GITHUB_USER:$GITHUB_PASSWORD -X POST https://api.github.com/repos/nextcloud/android/issues/$PR/comments \
-d "{ \"body\" : \"$TYPE test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/$REMOTE_FOLDER \" }"
-d "{ \"body\" : \"$BRANCH_TYPE test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/$REMOTE_FOLDER \" }"
exit 1
}
@ -31,7 +38,8 @@ TYPE=$5
PR=$6
GITHUB_USER=$7
GITHUB_PASSWORD=$8
REMOTE_FOLDER=$ID-$TYPE
REMOTE_FOLDER=$ID-$TYPE-$BRANCH
BRANCH_TYPE=$BRANCH-$TYPE
set -e
@ -46,24 +54,27 @@ fi
if [ -e $FOLDER ]; then
upload $FOLDER
else
echo "$BRANCH-$TYPE test failed, but no output was generated. Maybe a preliminary stage failed."
echo "$BRANCH_TYPE test failed, but no output was generated. Maybe a preliminary stage failed."
curl -u $GITHUB_USER:$GITHUB_PASSWORD \
-X POST https://api.github.com/repos/nextcloud/android/issues/$PR/comments \
-d "{ \"body\" : \"$BRANCH-$TYPE test failed, but no output was generated. Maybe a preliminary stage failed. \" }"
-d "{ \"body\" : \"$BRANCH_TYPE test failed, but no output was generated. Maybe a preliminary stage failed. \" }"
if [ -e build/reports/androidTests/connected/flavors/GPLAY ] ; then
TYPE="IT"
BRANCH_TYPE=$BRANCH-$TYPE
upload "build/reports/androidTests/connected/flavors/GPLAY"
fi
if [ -e build/reports/tests/testGplayDebugUnitTest ] ; then
TYPE="Unit"
BRANCH_TYPE=$BRANCH-$TYPE
upload "build/reports/tests/testGplayDebugUnitTest"
fi
if [ -e build/reports/shot/verification ] ; then
TYPE="Screenshot"
BRANCH_TYPE=$BRANCH-$TYPE
upload "build/reports/shot/verification"
fi
fi

View file

@ -32,6 +32,7 @@
<Or>
<Class name="~.*BindingImpl"/>
<Class name="~.*\.DataBinderMapperImpl" />
<Class name="~.*Binding" />
</Or>
</Match>

View file

@ -66,12 +66,6 @@
</intent-filter>
</service>
<service
android:name="com.evernote.android.job.gcm.PlatformGcmService"
android:enabled="true"
tools:node="remove">
</service>
</application>
</manifest>

View file

@ -76,6 +76,7 @@ import java.util.List;
import java.util.Locale;
import androidx.annotation.NonNull;
import androidx.core.content.res.ResourcesCompat;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
/**
@ -888,7 +889,7 @@ public final class ThumbnailsCacheManager {
Log_OC.e(TAG, "Out of memory");
} catch (Throwable t) {
// the app should never break due to a problem with avatars
thumbnail = mResources.getDrawable(R.drawable.account_circle_white);
thumbnail = ResourcesCompat.getDrawable(mResources, R.drawable.account_circle_white, null);
Log_OC.e(TAG, "Generation of avatar for " + mUserId + " failed", t);
}
@ -1011,7 +1012,7 @@ public final class ThumbnailsCacheManager {
try {
return TextDrawable.createAvatar(mAccount, mAvatarRadius);
} catch (Exception e1) {
return mResources.getDrawable(R.drawable.ic_user);
return ResourcesCompat.getDrawable(mResources, R.drawable.ic_user, null);
}
} else {
return BitmapUtils.bitmapToCircularBitmapDrawable(mResources, avatar);
@ -1060,17 +1061,19 @@ public final class ThumbnailsCacheManager {
return null;
}
public static Bitmap addVideoOverlay(Bitmap thumbnail){
Drawable playButtonDrawable = MainApp.getAppContext().getResources().getDrawable(R.drawable.view_play);
public static Bitmap addVideoOverlay(Bitmap thumbnail) {
Drawable playButtonDrawable = ResourcesCompat.getDrawable(MainApp.getAppContext().getResources(),
R.drawable.view_play,
null);
Bitmap playButton = BitmapUtils.drawableToBitmap(playButtonDrawable);
Bitmap resizedPlayButton = Bitmap.createScaledBitmap(playButton,
(int) (thumbnail.getWidth() * 0.3),
(int) (thumbnail.getHeight() * 0.3), true);
(int) (thumbnail.getWidth() * 0.3),
(int) (thumbnail.getHeight() * 0.3), true);
Bitmap resultBitmap = Bitmap.createBitmap(thumbnail.getWidth(),
thumbnail.getHeight(),
Bitmap.Config.ARGB_8888);
thumbnail.getHeight(),
Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(resultBitmap);

View file

@ -103,6 +103,7 @@ import javax.inject.Inject;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.core.content.ContextCompat;
import androidx.core.content.res.ResourcesCompat;
import androidx.core.view.GravityCompat;
import androidx.drawerlayout.widget.DrawerLayout;
@ -249,7 +250,9 @@ public abstract class DrawerActivity extends ToolbarActivity
mDrawerLayout.addDrawerListener(mDrawerToggle);
mDrawerToggle.setDrawerIndicatorEnabled(true);
mDrawerToggle.setDrawerSlideAnimationEnabled(true);
Drawable backArrow = getResources().getDrawable(R.drawable.ic_arrow_back);
Drawable backArrow = ResourcesCompat.getDrawable(getResources(),
R.drawable.ic_arrow_back,
null);
mDrawerToggle.setHomeAsUpIndicator(ThemeUtils.tintDrawable(backArrow, ThemeUtils.appBarPrimaryFontColor(this)));
mDrawerToggle.getDrawerArrowDrawable().setColor(ThemeUtils.appBarPrimaryFontColor(this));
}

View file

@ -39,6 +39,7 @@ import com.owncloud.android.utils.FileStorageUtils;
import java.io.File;
import androidx.appcompat.app.AlertDialog;
import androidx.core.content.res.ResourcesCompat;
/**
* @author Bartosz Przybylski
@ -212,7 +213,9 @@ public class StorageMigration {
askToStillMove();
} else {
mProgressDialog.getButton(ProgressDialog.BUTTON_POSITIVE).setVisibility(View.VISIBLE);
mProgressDialog.setIndeterminateDrawable(mContext.getResources().getDrawable(R.drawable.image_fail));
mProgressDialog.setIndeterminateDrawable(ResourcesCompat.getDrawable(mContext.getResources(),
R.drawable.image_fail,
null));
}
}

View file

@ -64,6 +64,7 @@ import javax.inject.Inject;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.SearchView;
import androidx.core.content.res.ResourcesCompat;
import androidx.core.view.MenuItemCompat;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentManager;
@ -190,10 +191,14 @@ public class UploadFilesActivity extends FileActivity implements LocalFileListFr
MaterialButton switchButton = findViewById(R.id.switch_grid_view_button);
switchButton.setOnClickListener(l -> {
if (isGridView()) {
switchButton.setIcon(getResources().getDrawable(R.drawable.ic_view_module));
switchButton.setIcon(ResourcesCompat.getDrawable(getResources(),
R.drawable.ic_view_module,
null));
mFileListFragment.switchToListView();
} else {
switchButton.setIcon(getResources().getDrawable(R.drawable.ic_view_list));
switchButton.setIcon(ResourcesCompat.getDrawable(getResources(),
R.drawable.ic_view_list,
null));
mFileListFragment.switchToGridView();
}

View file

@ -77,6 +77,7 @@ import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.StringRes;
import androidx.appcompat.app.ActionBar;
import androidx.core.content.res.ResourcesCompat;
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.Lifecycle;
@ -253,7 +254,9 @@ public class UserInfoActivity extends FileActivity implements Injectable {
@Override
public void onLoadFailed(Exception e, Drawable errorDrawable) {
Drawable[] drawables = {new ColorDrawable(primaryColor),
getResources().getDrawable(R.drawable.background)};
ResourcesCompat.getDrawable(getResources(),
R.drawable.background,
null)};
LayerDrawable layerDrawable = new LayerDrawable(drawables);
backgroundImageView.setImageDrawable(layerDrawable);
}

View file

@ -30,10 +30,8 @@ import android.content.ContentValues;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.LinearGradient;
import android.graphics.Point;
import android.graphics.PorterDuff;
import android.graphics.Shader;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.Looper;
@ -99,6 +97,7 @@ import java.util.Vector;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.res.ResourcesCompat;
import androidx.core.graphics.drawable.RoundedBitmapDrawable;
import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory;
import androidx.recyclerview.widget.RecyclerView;
@ -583,7 +582,7 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
placeholder = TextDrawable.createAvatarByUserId(userId, avatarRadius);
} catch (Exception e) {
Log_OC.e(TAG, "Error calculating RGB value for active account icon.", e);
placeholder = resources.getDrawable(R.drawable.account_circle_white);
placeholder = ResourcesCompat.getDrawable(resources, R.drawable.account_circle_white, null);
}
avatar.setTag(null);

View file

@ -65,7 +65,10 @@ public class SyncedFolderAdapter extends SectionedRecyclerViewAdapter<SectionedV
private final List<SyncedFolderDisplayItem> syncFolderItems;
private final List<SyncedFolderDisplayItem> filteredSyncFolderItems;
private final boolean light;
private final int VIEW_TYPE_EMPTY = Integer.MAX_VALUE;
private static final int VIEW_TYPE_EMPTY = Integer.MAX_VALUE;
private static final int VIEW_TYPE_ITEM = 1;
private static final int VIEW_TYPE_HEADER = 2;
private static final int VIEW_TYPE_FOOTER = 3;
private boolean hideItems;
public SyncedFolderAdapter(Context context, Clock clock, int gridWidth, ClickListener listener, boolean light) {

View file

@ -75,6 +75,7 @@ import java.util.List;
import javax.inject.Inject;
import androidx.annotation.NonNull;
import androidx.core.content.res.ResourcesCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
@ -250,11 +251,11 @@ public class FileDetailActivitiesFragment extends Fragment implements
OCCapability capability = storageManager.getCapability(account.name);
OwnCloudVersion serverVersion = accountManager.getServerVersion(account);
restoreFileVersionSupported = capability.getFilesVersioning().isTrue() &&
serverVersion.compareTo(OwnCloudVersion.nextcloud_14) >= 0;
serverVersion.compareTo(OwnCloudVersion.nextcloud_14) >= 0;
emptyContentProgressBar.getIndeterminateDrawable().setColorFilter(ThemeUtils.primaryAccentColor(getContext()),
PorterDuff.Mode.SRC_IN);
emptyContentIcon.setImageDrawable(getResources().getDrawable(R.drawable.ic_activity));
PorterDuff.Mode.SRC_IN);
emptyContentIcon.setImageDrawable(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_activity, null));
adapter = new ActivityAndVersionListAdapter(getContext(),
accountManager,
@ -414,7 +415,9 @@ public class FileDetailActivitiesFragment extends Fragment implements
private void setEmptyContent(String headline, String message) {
if (emptyContentContainer != null && emptyContentMessage != null) {
emptyContentIcon.setImageDrawable(requireContext().getResources().getDrawable(R.drawable.ic_activity));
emptyContentIcon.setImageDrawable(ResourcesCompat.getDrawable(requireContext().getResources(),
R.drawable.ic_activity,
null));
emptyContentHeadline.setText(headline);
emptyContentMessage.setText(message);
@ -427,7 +430,9 @@ public class FileDetailActivitiesFragment extends Fragment implements
private void setErrorContent(String message) {
if (emptyContentContainer != null && emptyContentMessage != null) {
emptyContentHeadline.setText(R.string.common_error);
emptyContentIcon.setImageDrawable(requireContext().getResources().getDrawable(R.drawable.ic_list_empty_error));
emptyContentIcon.setImageDrawable(ResourcesCompat.getDrawable(requireContext().getResources(),
R.drawable.ic_list_empty_error,
null));
emptyContentMessage.setText(message);
emptyContentMessage.setVisibility(View.VISIBLE);

View file

@ -75,6 +75,7 @@ import javax.inject.Inject;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.res.ResourcesCompat;
import androidx.viewpager.widget.ViewPager;
import butterknife.BindView;
import butterknife.ButterKnife;
@ -594,9 +595,11 @@ public class FileDetailFragment extends FileFragment implements OnClickListener,
private void setFavoriteIconStatus(boolean isFavorite) {
if (isFavorite) {
favoriteIcon.setImageDrawable(getResources().getDrawable(R.drawable.ic_star));
favoriteIcon.setImageDrawable(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_star, null));
} else {
favoriteIcon.setImageDrawable(getResources().getDrawable(R.drawable.ic_star_outline));
favoriteIcon.setImageDrawable(ResourcesCompat.getDrawable(getResources(),
R.drawable.ic_star_outline,
null));
}
}

View file

@ -87,6 +87,7 @@ import javax.inject.Inject;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.StringRes;
import androidx.core.content.res.ResourcesCompat;
import androidx.fragment.app.FragmentStatePagerAdapter;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import pl.droidsonroids.gif.GifDrawable;
@ -811,9 +812,9 @@ public class PreviewImageFragment extends FileFragment implements Injectable {
Drawable layerOne;
if (previewImageActivity.isSystemUIVisible()) {
layerOne = getResources().getDrawable(R.color.bg_default);
layerOne = ResourcesCompat.getDrawable(getResources(), R.color.bg_default, null);
} else {
layerOne = getResources().getDrawable(R.drawable.backrepeat);
layerOne = ResourcesCompat.getDrawable(getResources(), R.drawable.backrepeat, null);
}
layerDrawable.setDrawableByLayerId(layerDrawable.getId(0), layerOne);

View file

@ -55,6 +55,7 @@ import java.util.List;
import javax.inject.Inject;
import androidx.core.content.res.ResourcesCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import butterknife.BindString;
@ -304,7 +305,9 @@ public class TrashbinActivity extends FileActivity implements
if (emptyContentMessage != null) {
emptyContentHeadline.setText(R.string.common_error);
emptyContentIcon.setImageDrawable(getResources().getDrawable(R.drawable.ic_list_empty_error));
emptyContentIcon.setImageDrawable(ResourcesCompat.getDrawable(getResources(),
R.drawable.ic_list_empty_error,
null));
emptyContentMessage.setText(message);
emptyContentMessage.setVisibility(View.VISIBLE);

View file

@ -34,6 +34,8 @@ import android.widget.LinearLayout;
import com.owncloud.android.R;
import androidx.core.content.res.ResourcesCompat;
/**
* Progress indicator visualizing the actual progress with dots.
*/
@ -69,7 +71,9 @@ public class ProgressIndicator extends FrameLayout {
mDotsContainer.removeAllViews();
for (int i = 0; i < steps; ++i) {
ImageView iv = new ImageView(getContext());
iv.setImageDrawable(getContext().getResources().getDrawable(R.drawable.whats_new_progress_transition));
iv.setImageDrawable(ResourcesCompat.getDrawable(getContext().getResources(),
R.drawable.whats_new_progress_transition,
null));
iv.setColorFilter(fontColor, PorterDuff.Mode.SRC_ATOP);
mDotsContainer.addView(iv);
}

View file

@ -98,6 +98,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.widget.AppCompatDrawableManager;
import androidx.core.content.res.ResourcesCompat;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
@ -490,7 +491,9 @@ public final class DisplayUtils {
avatar = TextDrawable.createAvatarByUserId(displayName, avatarRadius);
} catch (Exception e) {
Log_OC.e(TAG, "Error calculating RGB value for active account icon.", e);
avatar = resources.getDrawable(R.drawable.account_circle_white);
avatar = ResourcesCompat.getDrawable(resources,
R.drawable.account_circle_white,
null);
}
}

View file

@ -347,7 +347,7 @@ public final class ThemeUtils {
return;
}
Drawable backArrow = context.getResources().getDrawable(R.drawable.ic_arrow_back);
Drawable backArrow = ResourcesCompat.getDrawable(context.getResources(), R.drawable.ic_arrow_back, null);
supportActionBar.setHomeAsUpIndicator(ThemeUtils.tintDrawable(backArrow, color));
}

View file

@ -22,6 +22,7 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
@ -38,7 +39,6 @@
android:src="@drawable/logo" />
<ScrollView
android:id="@+id/scroll"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
@ -148,7 +148,7 @@
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/alternate_half_margin"
android:contentDescription="@string/auth_testing_connection"
android:drawableStart="@android:drawable/stat_notify_sync"
app:drawableStartCompat="@android:drawable/stat_notify_sync"
android:drawablePadding="@dimen/alternate_half_padding"
android:gravity="center_vertical"
android:minHeight="@dimen/display_text_min_height"
@ -185,7 +185,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/auth_unauthorized"
android:drawableStart="@android:drawable/stat_notify_sync"
app:drawableStartCompat="@android:drawable/stat_notify_sync"
android:drawablePadding="@dimen/alternate_half_padding"
android:gravity="center_vertical"
android:text="@string/auth_unauthorized"

View file

@ -149,7 +149,7 @@
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/alternate_margin"
android:contentDescription="@string/auth_testing_connection"
android:drawableStart="@android:drawable/stat_notify_sync"
app:drawableStartCompat="@android:drawable/stat_notify_sync"
android:drawablePadding="@dimen/alternate_half_padding"
android:gravity="center_vertical"
android:minHeight="@dimen/display_text_min_height"
@ -187,7 +187,7 @@
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/alternate_margin"
android:contentDescription="@string/auth_unauthorized"
android:drawableStart="@android:drawable/stat_notify_sync"
app:drawableStartCompat="@android:drawable/stat_notify_sync"
android:drawablePadding="@dimen/alternate_half_padding"
android:gravity="center_vertical"
android:text="@string/auth_unauthorized"

View file

@ -19,6 +19,7 @@
License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_header_view"
android:layout_width="match_parent"
android:layout_height="@dimen/drawer_header_height"
@ -32,6 +33,6 @@
android:contentDescription="@string/empty"
android:scaleType="fitCenter"
android:src="@drawable/nextcloud_logo"
android:tint="@color/drawer_logo_color" />
app:tint="@color/drawer_logo_color" />
</FrameLayout>

View file

@ -18,22 +18,23 @@
License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/info_box"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom"
android:background="@color/filelist_icon_background"
android:gravity="center"
android:padding="@dimen/standard_half_padding"
android:visibility="gone">
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/info_box"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom"
android:background="@color/filelist_icon_background"
android:gravity="center"
android:padding="@dimen/standard_half_padding"
android:visibility="gone">
<TextView
android:id="@+id/info_box_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="@dimen/standard_half_padding"
android:drawableStart="@drawable/ic_information_outline"
app:drawableStartCompat="@drawable/ic_information_outline"
android:gravity="center"
android:paddingEnd="@dimen/standard_half_margin"
android:paddingLeft="@dimen/standard_half_padding"