NoRelayoutTextView: Enable requestLayout in more cases (#7175)
This commit is contained in:
parent
084723ad76
commit
8d3eb6aae9
@ -1,13 +1,14 @@
|
||||
package de.danoeh.antennapod.ui.screen.playback.audio;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Parcelable;
|
||||
import android.util.AttributeSet;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
|
||||
public class NoRelayoutTextView extends AppCompatTextView {
|
||||
private boolean requestLayoutEnabled = false;
|
||||
private boolean requestLayoutEnabled = true;
|
||||
private float maxTextLength = 0;
|
||||
|
||||
public NoRelayoutTextView(@NonNull Context context) {
|
||||
@ -30,6 +31,12 @@ public class NoRelayoutTextView extends AppCompatTextView {
|
||||
requestLayoutEnabled = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRestoreInstanceState(Parcelable state) {
|
||||
requestLayoutEnabled = true;
|
||||
super.onRestoreInstanceState(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setText(CharSequence text, BufferType type) {
|
||||
float textLength = getPaint().measureText(text.toString());
|
||||
|
Loading…
x
Reference in New Issue
Block a user