This commit is contained in:
Grishka 2023-10-01 23:11:33 +03:00
parent c5b52b2781
commit 1feccdc26d
4 changed files with 9 additions and 2 deletions

View File

@ -176,7 +176,7 @@ public class HashtagTimelineFragment extends StatusListFragment{
}
private void updateHeader(){
if(hashtag==null)
if(hashtag==null || getActivity()==null)
return;
if(hashtag.history!=null && !hashtag.history.isEmpty()){

View File

@ -822,7 +822,9 @@ public class PhotoViewer implements ZoomPanView.Listener{
@Override
public boolean onError(MediaPlayer mp, int what, int extra){
Log.e(TAG, "video player onError() called with: mp = ["+mp+"], what = ["+what+"], extra = ["+extra+"]");
return false;
Toast.makeText(activity, R.string.error_playing_video, Toast.LENGTH_SHORT).show();
onStartSwipeToDismissTransition(0f);
return true;
}
public void prepareAndStartPlayer(){

View File

@ -193,6 +193,9 @@ public class ZoomPanView extends FrameLayout implements ScaleGestureDetector.OnS
private float prepareTransitionCropRect(Rect rect){
float initialScale;
if(rect.isEmpty()){
rect.set(rect.centerX()-child.getWidth()/2, rect.centerY()-child.getHeight()/2, rect.centerX()+child.getWidth()/2, rect.centerY()+child.getWidth()/2);
}
float scaleW=rect.width()/(float)child.getWidth();
float scaleH=rect.height()/(float)child.getHeight();
if(scaleW>scaleH){

View File

@ -608,4 +608,6 @@
<item quantity="one">%,d post today</item>
<item quantity="other">%,d posts today</item>
</plurals>
<string name="error_playing_video">Error playing video</string>
</resources>