Loading core/java/com/android/internal/widget/ImageFloatingTextView.java +10 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ import android.view.RemotableViewMethod; import android.widget.RemoteViews; import android.widget.TextView; import com.android.internal.R; /** * A TextView that can float around an image on the end. * Loading @@ -49,6 +51,7 @@ public class ImageFloatingTextView extends TextView { private int mMaxLinesForHeight = -1; private int mLayoutMaxLines = -1; private int mImageEndMargin; private final int mMaxLineUpperLimit; private int mStaticLayoutCreationCountInOnMeasure = 0; Loading @@ -71,6 +74,8 @@ public class ImageFloatingTextView extends TextView { super(context, attrs, defStyleAttr, defStyleRes); setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL_FAST); setBreakStrategy(Layout.BREAK_STRATEGY_HIGH_QUALITY); mMaxLineUpperLimit = getResources().getInteger(R.integer.config_notificationLongTextMaxLineCount); } @Override Loading Loading @@ -102,6 +107,11 @@ public class ImageFloatingTextView extends TextView { } else { maxLines = getMaxLines() >= 0 ? getMaxLines() : Integer.MAX_VALUE; } if (mMaxLineUpperLimit > 0) { maxLines = Math.min(maxLines, mMaxLineUpperLimit); } builder.setMaxLines(maxLines); mLayoutMaxLines = maxLines; if (shouldEllipsize) { Loading core/res/res/values/config.xml +5 −0 Original line number Diff line number Diff line Loading @@ -1483,6 +1483,11 @@ <!-- Number of notifications to keep in the notification service historical archive --> <integer name="config_notificationServiceArchiveSize">100</integer> <!-- Upper limit imposed for long text content for BigTextStyle, MessagingStyle and ConversationStyle notifications for performance reasons, and that line count is also capped by vertical space available. It is only enabled when the value is positive int.--> <integer name="config_notificationLongTextMaxLineCount">10</integer> <!-- Allow the menu hard key to be disabled in LockScreen on some devices --> <bool name="config_disableMenuKeyInLockScreen">false</bool> Loading core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -2078,6 +2078,7 @@ <java-symbol type="integer" name="config_notificationsBatteryMediumARGB" /> <java-symbol type="integer" name="config_notificationsBatteryNearlyFullLevel" /> <java-symbol type="integer" name="config_notificationServiceArchiveSize" /> <java-symbol type="integer" name="config_notificationLongTextMaxLineCount" /> <java-symbol type="dimen" name="config_rotaryEncoderAxisScrollTickInterval" /> <java-symbol type="integer" name="config_recentVibrationsDumpSizeLimit" /> <java-symbol type="integer" name="config_previousVibrationsDumpSizeLimit" /> Loading Loading
core/java/com/android/internal/widget/ImageFloatingTextView.java +10 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ import android.view.RemotableViewMethod; import android.widget.RemoteViews; import android.widget.TextView; import com.android.internal.R; /** * A TextView that can float around an image on the end. * Loading @@ -49,6 +51,7 @@ public class ImageFloatingTextView extends TextView { private int mMaxLinesForHeight = -1; private int mLayoutMaxLines = -1; private int mImageEndMargin; private final int mMaxLineUpperLimit; private int mStaticLayoutCreationCountInOnMeasure = 0; Loading @@ -71,6 +74,8 @@ public class ImageFloatingTextView extends TextView { super(context, attrs, defStyleAttr, defStyleRes); setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL_FAST); setBreakStrategy(Layout.BREAK_STRATEGY_HIGH_QUALITY); mMaxLineUpperLimit = getResources().getInteger(R.integer.config_notificationLongTextMaxLineCount); } @Override Loading Loading @@ -102,6 +107,11 @@ public class ImageFloatingTextView extends TextView { } else { maxLines = getMaxLines() >= 0 ? getMaxLines() : Integer.MAX_VALUE; } if (mMaxLineUpperLimit > 0) { maxLines = Math.min(maxLines, mMaxLineUpperLimit); } builder.setMaxLines(maxLines); mLayoutMaxLines = maxLines; if (shouldEllipsize) { Loading
core/res/res/values/config.xml +5 −0 Original line number Diff line number Diff line Loading @@ -1483,6 +1483,11 @@ <!-- Number of notifications to keep in the notification service historical archive --> <integer name="config_notificationServiceArchiveSize">100</integer> <!-- Upper limit imposed for long text content for BigTextStyle, MessagingStyle and ConversationStyle notifications for performance reasons, and that line count is also capped by vertical space available. It is only enabled when the value is positive int.--> <integer name="config_notificationLongTextMaxLineCount">10</integer> <!-- Allow the menu hard key to be disabled in LockScreen on some devices --> <bool name="config_disableMenuKeyInLockScreen">false</bool> Loading
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -2078,6 +2078,7 @@ <java-symbol type="integer" name="config_notificationsBatteryMediumARGB" /> <java-symbol type="integer" name="config_notificationsBatteryNearlyFullLevel" /> <java-symbol type="integer" name="config_notificationServiceArchiveSize" /> <java-symbol type="integer" name="config_notificationLongTextMaxLineCount" /> <java-symbol type="dimen" name="config_rotaryEncoderAxisScrollTickInterval" /> <java-symbol type="integer" name="config_recentVibrationsDumpSizeLimit" /> <java-symbol type="integer" name="config_previousVibrationsDumpSizeLimit" /> Loading