Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Unified Diff: base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java

Issue 1995433003: Adding elevation to NTP snippets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/android/java/res/drawable/snippet_separator.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
diff --git a/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java b/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
index 870347ac29a16dd4bfabd0bc29dff7d399379f45..04b647b2dac6b5277b3f830ae651c07f7301e7e2 100644
--- a/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
+++ b/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
@@ -288,6 +288,17 @@ public class ApiCompatibilityUtils {
}
}
+ /**
+ * Set elevation if supported.
+ */
+ @TargetApi(Build.VERSION_CODES.LOLLIPOP)
+ public static boolean setElevation(View view, float elevationValue) {
+ if (!isElevationSupported()) return false;
+
+ view.setElevation(elevationValue);
+ return true;
+ }
+
private static class FinishAndRemoveTaskWithRetry implements Runnable {
private static final long RETRY_DELAY_MS = 500;
private static final long MAX_TRY_COUNT = 3;
« no previous file with comments | « no previous file | chrome/android/java/res/drawable/snippet_separator.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698