diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/discover/SearchFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/discover/SearchFragment.java index a317c6c4..d51078af 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/discover/SearchFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/discover/SearchFragment.java @@ -121,8 +121,10 @@ public class SearchFragment extends BaseStatusListFragment{ }else{ type=null; } - if(currentQuery==null) + if(currentQuery==null){ + dataLoaded(); return; + } currentRequest=new GetSearchResults(currentQuery, type, true) .setCallback(new Callback<>(){ @Override diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/discover/SearchQueryFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/discover/SearchQueryFragment.java index c2561836..4b183cfe 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/discover/SearchQueryFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/discover/SearchQueryFragment.java @@ -54,6 +54,7 @@ import java.util.stream.Stream; import androidx.annotation.Keep; import androidx.annotation.NonNull; +import androidx.annotation.RequiresApi; import androidx.recyclerview.widget.RecyclerView; import me.grishka.appkit.Nav; import me.grishka.appkit.api.SimpleCallback; @@ -287,6 +288,14 @@ public class SearchQueryFragment extends MastodonRecyclerFragment=Build.VERSION_CODES.S){ WindowInsets insets=container.getRootWindowInsets(); screenRadius=Math.min( - Math.min(insets.getRoundedCorner(RoundedCorner.POSITION_TOP_LEFT).getRadius(), insets.getRoundedCorner(RoundedCorner.POSITION_TOP_RIGHT).getRadius()), - Math.min(insets.getRoundedCorner(RoundedCorner.POSITION_BOTTOM_LEFT).getRadius(), insets.getRoundedCorner(RoundedCorner.POSITION_BOTTOM_RIGHT).getRadius()) + Math.min(getScreenCornerRadius(insets, RoundedCorner.POSITION_TOP_LEFT), getScreenCornerRadius(insets, RoundedCorner.POSITION_TOP_RIGHT)), + Math.min(getScreenCornerRadius(insets, RoundedCorner.POSITION_BOTTOM_LEFT), getScreenCornerRadius(insets, RoundedCorner.POSITION_BOTTOM_RIGHT)) ); }else{ screenRadius=0; diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/viewcontrollers/ComposeMediaViewController.java b/mastodon/src/main/java/org/joinmastodon/android/ui/viewcontrollers/ComposeMediaViewController.java index 1e9dfc30..8b889875 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/viewcontrollers/ComposeMediaViewController.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/viewcontrollers/ComposeMediaViewController.java @@ -315,6 +315,8 @@ public class ComposeMediaViewController{ .setProgressListener(new ProgressListener(){ @Override public void onProgress(long transferred, long total){ + if(fragment.getActivity()==null) + return; float progressFraction=transferred/(float)total; int progress=Math.round(progressFraction*attachment.progressBar.getMax()); if(Build.VERSION.SDK_INT>=24) diff --git a/mastodon/src/main/res/values/styles.xml b/mastodon/src/main/res/values/styles.xml index 7702f74e..c5017e88 100644 --- a/mastodon/src/main/res/values/styles.xml +++ b/mastodon/src/main/res/values/styles.xml @@ -8,7 +8,7 @@ @color/m3_sys_light_surface @style/Widget.Mastodon.EditText - @style/Widget.Mastodon.M3.Button + @style/Widget.Mastodon.M3.Button.Filled @style/Theme.Mastodon.Toolbar @style/Theme.Mastodon.Dialog.Alert