mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Update AndroidX Browser and ExifInterface to latest version (#4223)
This commit is contained in:
parent
1a31265770
commit
ee50bc8188
4 changed files with 12 additions and 7 deletions
|
|
@ -118,10 +118,10 @@ dependencies {
|
||||||
|
|
||||||
// Support libraries
|
// Support libraries
|
||||||
implementation "com.google.android.material:material:1.1.0-alpha04"
|
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.cardview:cardview:1.0.0"
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
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.core:core-ktx:$CORE_KTX_VERSION"
|
||||||
implementation "androidx.multidex:multidex:2.0.1"
|
implementation "androidx.multidex:multidex:2.0.1"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.browser.customtabs.CustomTabColorSchemeParams;
|
||||||
import androidx.browser.customtabs.CustomTabsIntent;
|
import androidx.browser.customtabs.CustomTabsIntent;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
|
@ -139,9 +140,13 @@ public class Utils {
|
||||||
return;
|
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();
|
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
|
||||||
builder.setToolbarColor(ContextCompat.getColor(context, R.color.primaryColor));
|
builder.setDefaultColorSchemeParams(color);
|
||||||
builder.setSecondaryToolbarColor(ContextCompat.getColor(context, R.color.primaryDarkColor));
|
|
||||||
builder.setExitAnimations(context, android.R.anim.slide_in_left, android.R.anim.slide_out_right);
|
builder.setExitAnimations(context, android.R.anim.slide_in_left, android.R.anim.slide_out_right);
|
||||||
CustomTabsIntent customTabsIntent = builder.build();
|
CustomTabsIntent customTabsIntent = builder.build();
|
||||||
// Clear previous browser tasks, so that back/exit buttons work as intended.
|
// Clear previous browser tasks, so that back/exit buttons work as intended.
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import timber.log.Timber;
|
||||||
|
|
||||||
import static androidx.exifinterface.media.ExifInterface.TAG_ARTIST;
|
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_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_COPYRIGHT;
|
||||||
import static androidx.exifinterface.media.ExifInterface.TAG_GPS_ALTITUDE;
|
import static androidx.exifinterface.media.ExifInterface.TAG_GPS_ALTITUDE;
|
||||||
import static androidx.exifinterface.media.ExifInterface.TAG_GPS_ALTITUDE_REF;
|
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);
|
Timber.d("Retuning tags for pref:%s", pref);
|
||||||
switch (pref) {
|
switch (pref) {
|
||||||
case "Author":
|
case "Author":
|
||||||
return new String[]{TAG_ARTIST, TAG_CAMARA_OWNER_NAME};
|
return new String[]{TAG_ARTIST, TAG_CAMERA_OWNER_NAME};
|
||||||
case "Copyright":
|
case "Copyright":
|
||||||
return new String[]{TAG_COPYRIGHT};
|
return new String[]{TAG_COPYRIGHT};
|
||||||
case "Location":
|
case "Location":
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ class FileMetadataUtilsTest {
|
||||||
@Test
|
@Test
|
||||||
fun getTagsFromPrefAuthor() {
|
fun getTagsFromPrefAuthor() {
|
||||||
val author = FileMetadataUtils.getTagsFromPref("Author")
|
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))
|
assertTrue(Arrays.deepEquals(author, authorRef))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue