[lint] Fix Wrong Resource Type am: 7aaceaa782
am: 68159be3ee
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23734154 Change-Id: I3ce015dfd694e6c7cbdb247a2026e845ea3eb717 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -20,9 +20,8 @@ import android.content.Context;
|
|||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.util.SparseIntArray;
|
import android.util.SparseIntArray;
|
||||||
import android.view.View;
|
|
||||||
|
|
||||||
import androidx.annotation.IdRes;
|
import androidx.annotation.DrawableRes;
|
||||||
import androidx.annotation.IntDef;
|
import androidx.annotation.IntDef;
|
||||||
import androidx.annotation.VisibleForTesting;
|
import androidx.annotation.VisibleForTesting;
|
||||||
import androidx.preference.Preference;
|
import androidx.preference.Preference;
|
||||||
@@ -134,7 +133,8 @@ public abstract class BatteryTip implements Comparable<BatteryTip>, Parcelable {
|
|||||||
|
|
||||||
public abstract CharSequence getSummary(Context context);
|
public abstract CharSequence getSummary(Context context);
|
||||||
|
|
||||||
@IdRes
|
/** Gets the drawable resource id for the icon. */
|
||||||
|
@DrawableRes
|
||||||
public abstract int getIconId();
|
public abstract int getIconId();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -162,21 +162,12 @@ public abstract class BatteryTip implements Comparable<BatteryTip>, Parcelable {
|
|||||||
preference.setTitle(getTitle(context));
|
preference.setTitle(getTitle(context));
|
||||||
preference.setSummary(getSummary(context));
|
preference.setSummary(getSummary(context));
|
||||||
preference.setIcon(getIconId());
|
preference.setIcon(getIconId());
|
||||||
@IdRes int iconTintColorId = getIconTintColorId();
|
|
||||||
if (iconTintColorId != View.NO_ID) {
|
|
||||||
preference.getIcon().setTint(context.getColor(iconTintColorId));
|
|
||||||
}
|
|
||||||
final CardPreference cardPreference = castToCardPreferenceSafely(preference);
|
final CardPreference cardPreference = castToCardPreferenceSafely(preference);
|
||||||
if (cardPreference != null) {
|
if (cardPreference != null) {
|
||||||
cardPreference.resetLayoutState();
|
cardPreference.resetLayoutState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the color resid for tinting {@link #getIconId()} or {@link View#NO_ID} if none. */
|
|
||||||
public @IdRes int getIconTintColorId() {
|
|
||||||
return View.NO_ID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean shouldShowDialog() {
|
public boolean shouldShowDialog() {
|
||||||
return mShowDialog;
|
return mShowDialog;
|
||||||
}
|
}
|
||||||
|
@@ -69,7 +69,7 @@ public class WifiAPITest extends SettingsPreferenceFragment implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||||
addPreferencesFromResource(R.layout.wifi_api_test);
|
addPreferencesFromResource(R.xml.wifi_api_test);
|
||||||
|
|
||||||
final PreferenceScreen preferenceScreen = getPreferenceScreen();
|
final PreferenceScreen preferenceScreen = getPreferenceScreen();
|
||||||
|
|
||||||
|
@@ -18,11 +18,11 @@ package com.android.settings.fuelgauge.batterytip.tips;
|
|||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.view.View;
|
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.annotation.IdRes;
|
import androidx.annotation.DrawableRes;
|
||||||
import androidx.preference.Preference;
|
import androidx.preference.Preference;
|
||||||
import androidx.preference.PreferenceViewHolder;
|
import androidx.preference.PreferenceViewHolder;
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ public class BatteryTipTest {
|
|||||||
|
|
||||||
private static final String TITLE = "title";
|
private static final String TITLE = "title";
|
||||||
private static final String SUMMARY = "summary";
|
private static final String SUMMARY = "summary";
|
||||||
@IdRes
|
@DrawableRes
|
||||||
private static final int ICON_ID = R.drawable.ic_fingerprint;
|
private static final int ICON_ID = R.drawable.ic_fingerprint;
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
Reference in New Issue
Block a user