Update AndroidX Browser and ExifInterface to latest version (#4223)

This commit is contained in:
Taco 2021-02-15 07:35:20 -05:00 committed by GitHub
parent 1a31265770
commit ee50bc8188
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 7 deletions

View file

@ -118,10 +118,10 @@ dependencies {
// Support libraries
implementation "com.google.android.material:material:1.1.0-alpha04"
implementation "androidx.browser:browser:1.0.0"
implementation "androidx.browser:browser:1.3.0"
implementation "androidx.cardview:cardview:1.0.0"
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation "androidx.exifinterface:exifinterface:1.0.0"
implementation "androidx.exifinterface:exifinterface:1.3.2"
implementation "androidx.core:core-ktx:$CORE_KTX_VERSION"
implementation "androidx.multidex:multidex:2.0.1"

View file

@ -13,6 +13,7 @@ import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.browser.customtabs.CustomTabColorSchemeParams;
import androidx.browser.customtabs.CustomTabsIntent;
import androidx.core.content.ContextCompat;
@ -139,9 +140,13 @@ public class Utils {
return;
}
final CustomTabColorSchemeParams color = new CustomTabColorSchemeParams.Builder()
.setToolbarColor(ContextCompat.getColor(context, R.color.primaryColor))
.setSecondaryToolbarColor(ContextCompat.getColor(context, R.color.primaryDarkColor))
.build();
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
builder.setToolbarColor(ContextCompat.getColor(context, R.color.primaryColor));
builder.setSecondaryToolbarColor(ContextCompat.getColor(context, R.color.primaryDarkColor));
builder.setDefaultColorSchemeParams(color);
builder.setExitAnimations(context, android.R.anim.slide_in_left, android.R.anim.slide_out_right);
CustomTabsIntent customTabsIntent = builder.build();
// Clear previous browser tasks, so that back/exit buttons work as intended.

View file

@ -4,7 +4,7 @@ import timber.log.Timber;
import static androidx.exifinterface.media.ExifInterface.TAG_ARTIST;
import static androidx.exifinterface.media.ExifInterface.TAG_BODY_SERIAL_NUMBER;
import static androidx.exifinterface.media.ExifInterface.TAG_CAMARA_OWNER_NAME;
import static androidx.exifinterface.media.ExifInterface.TAG_CAMERA_OWNER_NAME;
import static androidx.exifinterface.media.ExifInterface.TAG_COPYRIGHT;
import static androidx.exifinterface.media.ExifInterface.TAG_GPS_ALTITUDE;
import static androidx.exifinterface.media.ExifInterface.TAG_GPS_ALTITUDE_REF;
@ -36,7 +36,7 @@ public class FileMetadataUtils {
Timber.d("Retuning tags for pref:%s", pref);
switch (pref) {
case "Author":
return new String[]{TAG_ARTIST, TAG_CAMARA_OWNER_NAME};
return new String[]{TAG_ARTIST, TAG_CAMERA_OWNER_NAME};
case "Copyright":
return new String[]{TAG_COPYRIGHT};
case "Location":

View file

@ -16,7 +16,7 @@ class FileMetadataUtilsTest {
@Test
fun getTagsFromPrefAuthor() {
val author = FileMetadataUtils.getTagsFromPref("Author")
val authorRef = arrayOf(TAG_ARTIST, TAG_CAMARA_OWNER_NAME);
val authorRef = arrayOf(TAG_ARTIST, TAG_CAMERA_OWNER_NAME);
assertTrue(Arrays.deepEquals(author, authorRef))
}