Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
grishka committed Oct 1, 2023
1 parent c5b52b2 commit 1feccdc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ protected void onUpdateToolbar(){
}

private void updateHeader(){
if(hashtag==null)
if(hashtag==null || getActivity()==null)
return;

if(hashtag.history!=null && !hashtag.history.isEmpty()){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,9 @@ private void startPlayer(){
@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(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ private void setCropAnimationValue(float val){

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){
Expand Down
2 changes: 2 additions & 0 deletions mastodon/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>

0 comments on commit 1feccdc

Please sign in to comment.