Merge "Visual updates to battery screen" into nyc-dev
am: 3212a4c * commit '3212a4c759055ba3f81848f0285b4f5fe3f3ab25': Visual updates to battery screen Change-Id: Idfbbd0da48dd5090e7bd760b275586e4e174dea4
This commit is contained in:
@@ -26,7 +26,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingStart="72dp"
|
android:paddingStart="72dp"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textColor="?android:attr/colorAccent" />
|
android:textColor="?android:attr/colorAccent" />
|
||||||
|
|
||||||
<com.android.systemui.ResizingSpace
|
<com.android.systemui.ResizingSpace
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import android.os.Looper;
|
|||||||
import android.text.SpannableStringBuilder;
|
import android.text.SpannableStringBuilder;
|
||||||
import android.text.Spanned;
|
import android.text.Spanned;
|
||||||
import android.text.style.RelativeSizeSpan;
|
import android.text.style.RelativeSizeSpan;
|
||||||
|
import android.util.TypedValue;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnAttachStateChangeListener;
|
import android.view.View.OnAttachStateChangeListener;
|
||||||
@@ -207,18 +208,21 @@ public class BatteryTile extends QSTile<QSTile.State> implements BatteryControll
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
final TextView batterySaverTitle =
|
||||||
|
(TextView) mCurrentView.findViewById(android.R.id.title);
|
||||||
|
final TextView batterySaverSummary =
|
||||||
|
(TextView) mCurrentView.findViewById(android.R.id.summary);
|
||||||
if (mCharging) {
|
if (mCharging) {
|
||||||
((TextView) mCurrentView.findViewById(android.R.id.title)).setText(
|
mCurrentView.findViewById(R.id.switch_container).setAlpha(.7f);
|
||||||
R.string.battery_detail_charging_summary);
|
batterySaverTitle.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
|
||||||
mCurrentView.findViewById(android.R.id.icon).setVisibility(View.INVISIBLE);
|
batterySaverTitle.setText(R.string.battery_detail_charging_summary);
|
||||||
mCurrentView.findViewById(android.R.id.toggle).setVisibility(View.GONE);
|
mCurrentView.findViewById(android.R.id.toggle).setVisibility(View.GONE);
|
||||||
mCurrentView.findViewById(R.id.switch_container).setClickable(false);
|
mCurrentView.findViewById(R.id.switch_container).setClickable(false);
|
||||||
} else {
|
} else {
|
||||||
((TextView) mCurrentView.findViewById(android.R.id.title)).setText(
|
mCurrentView.findViewById(R.id.switch_container).setAlpha(1);
|
||||||
R.string.battery_detail_switch_title);
|
batterySaverTitle.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
|
||||||
((TextView) mCurrentView.findViewById(android.R.id.summary)).setText(
|
batterySaverTitle.setText(R.string.battery_detail_switch_title);
|
||||||
R.string.battery_detail_switch_summary);
|
batterySaverSummary.setText(R.string.battery_detail_switch_summary);
|
||||||
mCurrentView.findViewById(android.R.id.icon).setVisibility(View.VISIBLE);
|
|
||||||
mCurrentView.findViewById(android.R.id.toggle).setVisibility(View.VISIBLE);
|
mCurrentView.findViewById(android.R.id.toggle).setVisibility(View.VISIBLE);
|
||||||
mCurrentView.findViewById(R.id.switch_container).setClickable(true);
|
mCurrentView.findViewById(R.id.switch_container).setClickable(true);
|
||||||
mCurrentView.findViewById(R.id.switch_container).setOnClickListener(this);
|
mCurrentView.findViewById(R.id.switch_container).setOnClickListener(this);
|
||||||
@@ -227,7 +231,7 @@ public class BatteryTile extends QSTile<QSTile.State> implements BatteryControll
|
|||||||
|
|
||||||
private void bindBatteryInfo(BatteryInfo info) {
|
private void bindBatteryInfo(BatteryInfo info) {
|
||||||
SpannableStringBuilder builder = new SpannableStringBuilder();
|
SpannableStringBuilder builder = new SpannableStringBuilder();
|
||||||
builder.append(info.batteryPercentString, new RelativeSizeSpan(2),
|
builder.append(info.batteryPercentString, new RelativeSizeSpan(2.6f),
|
||||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||||
if (info.remainingLabel != null) {
|
if (info.remainingLabel != null) {
|
||||||
if (mContext.getResources().getBoolean(R.bool.quick_settings_wide)) {
|
if (mContext.getResources().getBoolean(R.bool.quick_settings_wide)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user