145
145
import org .thunderdog .challegram .util .StringList ;
146
146
import org .thunderdog .challegram .util .text .Text ;
147
147
import org .thunderdog .challegram .util .text .TextEntity ;
148
+ import org .thunderdog .challegram .v .MaxHeightScrollView ;
148
149
import org .thunderdog .challegram .widget .AttachDelegate ;
149
150
import org .thunderdog .challegram .widget .CheckView ;
150
151
import org .thunderdog .challegram .widget .CustomTextView ;
@@ -3133,7 +3134,7 @@ protected void onDraw (Canvas c) {
3133
3134
private StopwatchHeaderButton stopwatchButton ;
3134
3135
3135
3136
private FrameLayoutFix bottomWrap ;
3136
- private LinearLayout captionWrapView ;
3137
+ private ViewGroup captionWrapView ;
3137
3138
private View captionView ;
3138
3139
private InputView inputView ;
3139
3140
private ImageView captionEmojiButton , captionDoneButton ;
@@ -5197,14 +5198,21 @@ public boolean onTouchEvent (MotionEvent event) {
5197
5198
captionView .setLayoutParams (new RelativeLayout .LayoutParams (ViewGroup .LayoutParams .MATCH_PARENT , ViewGroup .LayoutParams .WRAP_CONTENT ));
5198
5199
this .captionView = captionView ;
5199
5200
5200
- captionWrapView = new LinearLayout (context );
5201
- captionWrapView .setOrientation (LinearLayout .VERTICAL );
5202
- captionWrapView .setBackgroundColor (Theme .getColor (ColorId .transparentEditor ));
5203
- captionWrapView .setAlpha (0f );
5204
- captionWrapView .addView (captionView );
5205
- captionWrapView .setLayoutParams (FrameLayoutFix .newParams (ViewGroup .LayoutParams .MATCH_PARENT , ViewGroup .LayoutParams .WRAP_CONTENT , Gravity .BOTTOM ));
5206
5201
5207
- bottomWrap .addView (captionWrapView );
5202
+ LinearLayout captionWrap = new LinearLayout (context );
5203
+ captionWrap .setOrientation (LinearLayout .VERTICAL );
5204
+ captionWrap .addView (captionView );
5205
+ captionWrap .setLayoutParams (new ViewGroup .LayoutParams (ViewGroup .LayoutParams .MATCH_PARENT , ViewGroup .LayoutParams .WRAP_CONTENT ));
5206
+
5207
+ MaxHeightScrollView scrollView = new MaxHeightScrollView (context );
5208
+ scrollView .setMaxHeight (Text .getLineHeight (TGMessage .getTextStyleProvider (), true ) * 10 );
5209
+ scrollView .addView (captionWrap );
5210
+ scrollView .setAlpha (0f );
5211
+ scrollView .setBackgroundColor (Theme .getColor (ColorId .transparentEditor ));
5212
+ scrollView .setLayoutParams (FrameLayoutFix .newParams (ViewGroup .LayoutParams .MATCH_PARENT , ViewGroup .LayoutParams .WRAP_CONTENT , Gravity .BOTTOM ));
5213
+ this .captionWrapView = scrollView ;
5214
+
5215
+ bottomWrap .addView (this .captionWrapView );
5208
5216
5209
5217
videoSliderView = new VideoControlView (context );
5210
5218
videoSliderView .setOnPlayPauseClick (v -> {
@@ -8476,7 +8484,7 @@ public boolean showSlowModeRestriction (View v) {
8476
8484
private Args forceEditModeOld_arguments ;
8477
8485
private FrameLayoutFix forceEditModeOld_bottomWrap ;
8478
8486
private View forceEditModeOld_captionView ;
8479
- private LinearLayout forceEditModeOld_captionWrapView ;
8487
+ private ViewGroup forceEditModeOld_captionWrapView ;
8480
8488
private List <View > forceEditMode_views ;
8481
8489
8482
8490
private boolean inForceEditMode () {
@@ -9009,7 +9017,7 @@ public void afterTextChanged (Editable s) {
9009
9017
captionEmojiButton .setEnabled (false );
9010
9018
captionEmojiButton .setLayoutParams (FrameLayoutFix .newParams (Screen .dp (55f ), Screen .dp (52f ), Gravity .LEFT | Gravity .BOTTOM ));
9011
9019
9012
- captionWrapView = new LinearLayout (context ) {
9020
+ LinearLayout captionWrapView = new LinearLayout (context ) {
9013
9021
@ Override
9014
9022
public boolean onInterceptTouchEvent (MotionEvent ev ) {
9015
9023
return getVisibility () != View .VISIBLE || getAlpha () != 1f ;
@@ -9036,6 +9044,7 @@ public boolean onTouchEvent (MotionEvent event) {
9036
9044
captionWrapView .setBackgroundColor (Theme .getColor (ColorId .transparentEditor ));
9037
9045
captionWrapView .addView (captionView );
9038
9046
captionWrapView .setLayoutParams (FrameLayoutFix .newParams (ViewGroup .LayoutParams .MATCH_PARENT , ViewGroup .LayoutParams .WRAP_CONTENT , Gravity .BOTTOM ));
9047
+ this .captionWrapView = captionWrapView ;
9039
9048
9040
9049
if (!inProfilePhotoEditMode ) {
9041
9050
bottomWrap .addView (captionWrapView );
0 commit comments