Refactored ColorStateList of attribution control to a Drawable selector, added images responding to different states.
@@ -9,9 +9,7 @@ import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.TypedArray;
|
||||
import android.content.res.XmlResourceParser;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.PointF;
|
||||
@@ -31,7 +29,6 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.graphics.drawable.DrawableCompat;
|
||||
import android.support.v4.view.GestureDetectorCompat;
|
||||
import android.support.v4.view.ScaleGestureDetectorCompat;
|
||||
import android.text.TextUtils;
|
||||
@@ -424,10 +421,7 @@ public class MapView extends FrameLayout implements LocationListener {
|
||||
|
||||
// Setup Attributions control
|
||||
mAttributionsView = new ImageView(mContext);
|
||||
Drawable attrDrawable = ContextCompat.getDrawable(mContext, R.drawable.ic_info_outline_black_24dp);
|
||||
attrDrawable = DrawableCompat.wrap(attrDrawable);
|
||||
DrawableCompat.setTintList(attrDrawable, getResources().getColorStateList(R.color.material_bg_selector, mContext.getTheme()));
|
||||
mAttributionsView.setImageDrawable(attrDrawable);
|
||||
mAttributionsView.setBackgroundResource(R.drawable.ic_info_selector);
|
||||
mAttributionsView.setContentDescription(getResources().getString(R.string.attributionsIconContentDescription));
|
||||
LayoutParams attrParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
mAttributionsView.setLayoutParams(attrParams);
|
||||
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 487 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 323 B |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 640 B |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 940 B |
|
After Width: | Height: | Size: 730 B |
|
After Width: | Height: | Size: 836 B |
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true" android:drawable="@drawable/ic_info_blue_pressed" />
|
||||
<item android:drawable="@drawable/ic_info_blue_normal" />
|
||||
</selector>
|
||||