From 183cb71663320f16149d83eeebaff7795a4b55f2 Mon Sep 17 00:00:00 2001 From: linyuh Date: Wed, 27 Dec 2017 17:02:37 -0800 Subject: Remove field prefixes. Test: Existing tests PiperOrigin-RevId: 180230450 Change-Id: I0b2589cfeeaef81e42a04efa48af24b4e4d0e95f --- .../dialer/calllogutils/CallTypeHelper.java | 102 ++++++++++----------- .../dialer/calllogutils/CallTypeIconsView.java | 78 ++++++++-------- 2 files changed, 90 insertions(+), 90 deletions(-) (limited to 'java/com/android/dialer/calllogutils') diff --git a/java/com/android/dialer/calllogutils/CallTypeHelper.java b/java/com/android/dialer/calllogutils/CallTypeHelper.java index e3c711d99..6feaeb998 100644 --- a/java/com/android/dialer/calllogutils/CallTypeHelper.java +++ b/java/com/android/dialer/calllogutils/CallTypeHelper.java @@ -24,65 +24,65 @@ import com.android.dialer.duo.Duo; public class CallTypeHelper { /** Name used to identify incoming calls. */ - private final CharSequence mIncomingName; + private final CharSequence incomingName; /** Name used to identify incoming calls which were transferred to another device. */ - private final CharSequence mIncomingPulledName; + private final CharSequence incomingPulledName; /** Name used to identify outgoing calls. */ - private final CharSequence mOutgoingName; + private final CharSequence outgoingName; /** Name used to identify outgoing calls which were transferred to another device. */ - private final CharSequence mOutgoingPulledName; + private final CharSequence outgoingPulledName; /** Name used to identify missed calls. */ - private final CharSequence mMissedName; + private final CharSequence missedName; /** Name used to identify incoming video calls. */ - private final CharSequence mIncomingVideoName; + private final CharSequence incomingVideoName; /** Name used to identify incoming video calls which were transferred to another device. */ - private final CharSequence mIncomingVideoPulledName; + private final CharSequence incomingVideoPulledName; /** Name used to identify outgoing video calls. */ - private final CharSequence mOutgoingVideoName; + private final CharSequence outgoingVideoName; /** Name used to identify outgoing video calls which were transferred to another device. */ - private final CharSequence mOutgoingVideoPulledName; + private final CharSequence outgoingVideoPulledName; /** Name used to identify missed video calls. */ - private final CharSequence mMissedVideoName; + private final CharSequence missedVideoName; /** Name used to identify voicemail calls. */ - private final CharSequence mVoicemailName; + private final CharSequence voicemailName; /** Name used to identify rejected calls. */ - private final CharSequence mRejectedName; + private final CharSequence rejectedName; /** Name used to identify blocked calls. */ - private final CharSequence mBlockedName; + private final CharSequence blockedName; /** Name used to identify calls which were answered on another device. */ - private final CharSequence mAnsweredElsewhereName; + private final CharSequence answeredElsewhereName; /** Name used to identify incoming Duo calls. */ - private final CharSequence mIncomingDuoCall; + private final CharSequence incomingDuoCall; /** Name used to identify outgoing Duo calls. */ - private final CharSequence mOutgoingDuoCall; + private final CharSequence outgoingDuoCall; public CallTypeHelper(Resources resources, Duo duo) { // Cache these values so that we do not need to look them up each time. - mIncomingName = resources.getString(R.string.type_incoming); - mIncomingPulledName = resources.getString(R.string.type_incoming_pulled); - mOutgoingName = resources.getString(R.string.type_outgoing); - mOutgoingPulledName = resources.getString(R.string.type_outgoing_pulled); - mMissedName = resources.getString(R.string.type_missed); - mIncomingVideoName = resources.getString(R.string.type_incoming_video); - mIncomingVideoPulledName = resources.getString(R.string.type_incoming_video_pulled); - mOutgoingVideoName = resources.getString(R.string.type_outgoing_video); - mOutgoingVideoPulledName = resources.getString(R.string.type_outgoing_video_pulled); - mMissedVideoName = resources.getString(R.string.type_missed_video); - mVoicemailName = resources.getString(R.string.type_voicemail); - mRejectedName = resources.getString(R.string.type_rejected); - mBlockedName = resources.getString(R.string.type_blocked); - mAnsweredElsewhereName = resources.getString(R.string.type_answered_elsewhere); + incomingName = resources.getString(R.string.type_incoming); + incomingPulledName = resources.getString(R.string.type_incoming_pulled); + outgoingName = resources.getString(R.string.type_outgoing); + outgoingPulledName = resources.getString(R.string.type_outgoing_pulled); + missedName = resources.getString(R.string.type_missed); + incomingVideoName = resources.getString(R.string.type_incoming_video); + incomingVideoPulledName = resources.getString(R.string.type_incoming_video_pulled); + outgoingVideoName = resources.getString(R.string.type_outgoing_video); + outgoingVideoPulledName = resources.getString(R.string.type_outgoing_video_pulled); + missedVideoName = resources.getString(R.string.type_missed_video); + voicemailName = resources.getString(R.string.type_voicemail); + rejectedName = resources.getString(R.string.type_rejected); + blockedName = resources.getString(R.string.type_blocked); + answeredElsewhereName = resources.getString(R.string.type_answered_elsewhere); if (duo.getIncomingCallTypeText() != -1) { - mIncomingDuoCall = resources.getString(duo.getIncomingCallTypeText()); + incomingDuoCall = resources.getString(duo.getIncomingCallTypeText()); } else { - mIncomingDuoCall = mIncomingVideoName; + incomingDuoCall = incomingVideoName; } if (duo.getOutgoingCallTypeText() != -1) { - mOutgoingDuoCall = resources.getString(duo.getOutgoingCallTypeText()); + outgoingDuoCall = resources.getString(duo.getOutgoingCallTypeText()); } else { - mOutgoingDuoCall = mOutgoingVideoName; + outgoingDuoCall = outgoingVideoName; } } @@ -100,60 +100,60 @@ public class CallTypeHelper { case AppCompatConstants.CALLS_INCOMING_TYPE: if (isVideoCall) { if (isPulledCall) { - return mIncomingVideoPulledName; + return incomingVideoPulledName; } else { if (isDuoCall) { - return mIncomingDuoCall; + return incomingDuoCall; } - return mIncomingVideoName; + return incomingVideoName; } } else { if (isPulledCall) { - return mIncomingPulledName; + return incomingPulledName; } else { - return mIncomingName; + return incomingName; } } case AppCompatConstants.CALLS_OUTGOING_TYPE: if (isVideoCall) { if (isPulledCall) { - return mOutgoingVideoPulledName; + return outgoingVideoPulledName; } else { if (isDuoCall) { - return mOutgoingDuoCall; + return outgoingDuoCall; } - return mOutgoingVideoName; + return outgoingVideoName; } } else { if (isPulledCall) { - return mOutgoingPulledName; + return outgoingPulledName; } else { - return mOutgoingName; + return outgoingName; } } case AppCompatConstants.CALLS_MISSED_TYPE: if (isVideoCall) { - return mMissedVideoName; + return missedVideoName; } else { - return mMissedName; + return missedName; } case AppCompatConstants.CALLS_VOICEMAIL_TYPE: - return mVoicemailName; + return voicemailName; case AppCompatConstants.CALLS_REJECTED_TYPE: - return mRejectedName; + return rejectedName; case AppCompatConstants.CALLS_BLOCKED_TYPE: - return mBlockedName; + return blockedName; case AppCompatConstants.CALLS_ANSWERED_EXTERNALLY_TYPE: - return mAnsweredElsewhereName; + return answeredElsewhereName; default: - return mMissedName; + return missedName; } } } diff --git a/java/com/android/dialer/calllogutils/CallTypeIconsView.java b/java/com/android/dialer/calllogutils/CallTypeIconsView.java index 0c28a9728..c7840c5ca 100644 --- a/java/com/android/dialer/calllogutils/CallTypeIconsView.java +++ b/java/com/android/dialer/calllogutils/CallTypeIconsView.java @@ -43,14 +43,14 @@ public class CallTypeIconsView extends View { private final boolean useLargeIcons; - private static Resources sResources; - private static Resources sLargeResouces; - private List mCallTypes = new ArrayList<>(3); - private boolean mShowVideo; - private boolean mShowHd; - private boolean mShowWifi; - private int mWidth; - private int mHeight; + private static Resources resources; + private static Resources largeResouces; + private List callTypes = new ArrayList<>(3); + private boolean showVideo; + private boolean showHd; + private boolean showWifi; + private int width; + private int height; public CallTypeIconsView(Context context) { this(context, null); @@ -62,27 +62,27 @@ public class CallTypeIconsView extends View { context.getTheme().obtainStyledAttributes(attrs, R.styleable.CallTypeIconsView, 0, 0); useLargeIcons = typedArray.getBoolean(R.styleable.CallTypeIconsView_useLargeIcons, false); typedArray.recycle(); - if (sResources == null) { - sResources = new Resources(context, false); + if (resources == null) { + resources = new Resources(context, false); } - if (sLargeResouces == null && useLargeIcons) { - sLargeResouces = new Resources(context, true); + if (largeResouces == null && useLargeIcons) { + largeResouces = new Resources(context, true); } } public void clear() { - mCallTypes.clear(); - mWidth = 0; - mHeight = 0; + callTypes.clear(); + width = 0; + height = 0; invalidate(); } public void add(int callType) { - mCallTypes.add(callType); + callTypes.add(callType); final Drawable drawable = getCallTypeDrawable(callType); - mWidth += drawable.getIntrinsicWidth() + sResources.iconMargin; - mHeight = Math.max(mHeight, drawable.getIntrinsicWidth()); + width += drawable.getIntrinsicWidth() + resources.iconMargin; + height = Math.max(height, drawable.getIntrinsicWidth()); invalidate(); } @@ -92,10 +92,10 @@ public class CallTypeIconsView extends View { * @param showVideo True where the video icon should be shown. */ public void setShowVideo(boolean showVideo) { - mShowVideo = showVideo; + this.showVideo = showVideo; if (showVideo) { - mWidth += sResources.videoCall.getIntrinsicWidth() + sResources.iconMargin; - mHeight = Math.max(mHeight, sResources.videoCall.getIntrinsicHeight()); + width += resources.videoCall.getIntrinsicWidth() + resources.iconMargin; + height = Math.max(height, resources.videoCall.getIntrinsicHeight()); invalidate(); } } @@ -106,42 +106,42 @@ public class CallTypeIconsView extends View { * @return True if the video icon should be shown. */ public boolean isVideoShown() { - return mShowVideo; + return showVideo; } public void setShowHd(boolean showHd) { - mShowHd = showHd; + this.showHd = showHd; if (showHd) { - mWidth += sResources.hdCall.getIntrinsicWidth() + sResources.iconMargin; - mHeight = Math.max(mHeight, sResources.hdCall.getIntrinsicHeight()); + width += resources.hdCall.getIntrinsicWidth() + resources.iconMargin; + height = Math.max(height, resources.hdCall.getIntrinsicHeight()); invalidate(); } } @VisibleForTesting public boolean isHdShown() { - return mShowHd; + return showHd; } public void setShowWifi(boolean showWifi) { - mShowWifi = showWifi; + this.showWifi = showWifi; if (showWifi) { - mWidth += sResources.wifiCall.getIntrinsicWidth() + sResources.iconMargin; - mHeight = Math.max(mHeight, sResources.wifiCall.getIntrinsicHeight()); + width += resources.wifiCall.getIntrinsicWidth() + resources.iconMargin; + height = Math.max(height, resources.wifiCall.getIntrinsicHeight()); invalidate(); } } public int getCount() { - return mCallTypes.size(); + return callTypes.size(); } public int getCallType(int index) { - return mCallTypes.get(index); + return callTypes.get(index); } private Drawable getCallTypeDrawable(int callType) { - Resources resources = useLargeIcons ? sLargeResouces : sResources; + Resources resources = useLargeIcons ? largeResouces : CallTypeIconsView.resources; switch (callType) { case AppCompatConstants.CALLS_INCOMING_TYPE: case AppCompatConstants.CALLS_ANSWERED_EXTERNALLY_TYPE: @@ -165,17 +165,17 @@ public class CallTypeIconsView extends View { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - setMeasuredDimension(mWidth, mHeight); + setMeasuredDimension(width, height); } @Override protected void onDraw(Canvas canvas) { - Resources resources = useLargeIcons ? sLargeResouces : sResources; + Resources resources = useLargeIcons ? largeResouces : CallTypeIconsView.resources; int left = 0; // If we are using large icons, we should only show one icon (video, hd or call type) with // priority give to HD or Video. So we skip the call type icon if we plan to show them. - if (!useLargeIcons || !(mShowHd || mShowVideo || mShowWifi)) { - for (Integer callType : mCallTypes) { + if (!useLargeIcons || !(showHd || showVideo || showWifi)) { + for (Integer callType : callTypes) { final Drawable drawable = getCallTypeDrawable(callType); final int right = left + drawable.getIntrinsicWidth(); drawable.setBounds(left, 0, right, drawable.getIntrinsicHeight()); @@ -185,15 +185,15 @@ public class CallTypeIconsView extends View { } // If showing the video call icon, draw it scaled appropriately. - if (mShowVideo) { + if (showVideo) { left = addDrawable(canvas, resources.videoCall, left) + resources.iconMargin; } // If showing HD call icon, draw it scaled appropriately. - if (mShowHd) { + if (showHd) { left = addDrawable(canvas, resources.hdCall, left) + resources.iconMargin; } // If showing HD call icon, draw it scaled appropriately. - if (mShowWifi) { + if (showWifi) { left = addDrawable(canvas, resources.wifiCall, left) + resources.iconMargin; } } -- cgit v1.2.3