parent
eb822282c0
commit
9a8cf61e38
|
@ -121,8 +121,10 @@ public class SearchFragment extends BaseStatusListFragment<SearchResult>{
|
||||||
}else{
|
}else{
|
||||||
type=null;
|
type=null;
|
||||||
}
|
}
|
||||||
if(currentQuery==null)
|
if(currentQuery==null){
|
||||||
|
dataLoaded();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
currentRequest=new GetSearchResults(currentQuery, type, true)
|
currentRequest=new GetSearchResults(currentQuery, type, true)
|
||||||
.setCallback(new Callback<>(){
|
.setCallback(new Callback<>(){
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -54,6 +54,7 @@ import java.util.stream.Stream;
|
||||||
|
|
||||||
import androidx.annotation.Keep;
|
import androidx.annotation.Keep;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import me.grishka.appkit.Nav;
|
import me.grishka.appkit.Nav;
|
||||||
import me.grishka.appkit.api.SimpleCallback;
|
import me.grishka.appkit.api.SimpleCallback;
|
||||||
|
@ -287,6 +288,14 @@ public class SearchQueryFragment extends MastodonRecyclerFragment<SearchResultVi
|
||||||
getActivity().getSystemService(InputMethodManager.class).hideSoftInputFromWindow(getActivity().getWindow().getDecorView().getWindowToken(), 0);
|
getActivity().getSystemService(InputMethodManager.class).hideSoftInputFromWindow(getActivity().getWindow().getDecorView().getWindowToken(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.S)
|
||||||
|
private float getScreenCornerRadius(WindowInsets insets, int pos){
|
||||||
|
RoundedCorner corner=insets.getRoundedCorner(pos);
|
||||||
|
if(corner==null)
|
||||||
|
return 0;
|
||||||
|
return corner.getRadius();
|
||||||
|
}
|
||||||
|
|
||||||
private Animator createTransition(View prev, View container, boolean enter){
|
private Animator createTransition(View prev, View container, boolean enter){
|
||||||
int[] loc={0, 0};
|
int[] loc={0, 0};
|
||||||
View searchBtn=prev.findViewById(R.id.search_wrap);
|
View searchBtn=prev.findViewById(R.id.search_wrap);
|
||||||
|
@ -299,8 +308,8 @@ public class SearchQueryFragment extends MastodonRecyclerFragment<SearchResultVi
|
||||||
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.S){
|
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.S){
|
||||||
WindowInsets insets=container.getRootWindowInsets();
|
WindowInsets insets=container.getRootWindowInsets();
|
||||||
screenRadius=Math.min(
|
screenRadius=Math.min(
|
||||||
Math.min(insets.getRoundedCorner(RoundedCorner.POSITION_TOP_LEFT).getRadius(), insets.getRoundedCorner(RoundedCorner.POSITION_TOP_RIGHT).getRadius()),
|
Math.min(getScreenCornerRadius(insets, RoundedCorner.POSITION_TOP_LEFT), getScreenCornerRadius(insets, RoundedCorner.POSITION_TOP_RIGHT)),
|
||||||
Math.min(insets.getRoundedCorner(RoundedCorner.POSITION_BOTTOM_LEFT).getRadius(), insets.getRoundedCorner(RoundedCorner.POSITION_BOTTOM_RIGHT).getRadius())
|
Math.min(getScreenCornerRadius(insets, RoundedCorner.POSITION_BOTTOM_LEFT), getScreenCornerRadius(insets, RoundedCorner.POSITION_BOTTOM_RIGHT))
|
||||||
);
|
);
|
||||||
}else{
|
}else{
|
||||||
screenRadius=0;
|
screenRadius=0;
|
||||||
|
|
|
@ -315,6 +315,8 @@ public class ComposeMediaViewController{
|
||||||
.setProgressListener(new ProgressListener(){
|
.setProgressListener(new ProgressListener(){
|
||||||
@Override
|
@Override
|
||||||
public void onProgress(long transferred, long total){
|
public void onProgress(long transferred, long total){
|
||||||
|
if(fragment.getActivity()==null)
|
||||||
|
return;
|
||||||
float progressFraction=transferred/(float)total;
|
float progressFraction=transferred/(float)total;
|
||||||
int progress=Math.round(progressFraction*attachment.progressBar.getMax());
|
int progress=Math.round(progressFraction*attachment.progressBar.getMax());
|
||||||
if(Build.VERSION.SDK_INT>=24)
|
if(Build.VERSION.SDK_INT>=24)
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<item name="android:windowBackground">@color/m3_sys_light_surface</item>
|
<item name="android:windowBackground">@color/m3_sys_light_surface</item>
|
||||||
<item name="android:editTextStyle">@style/Widget.Mastodon.EditText</item>
|
<item name="android:editTextStyle">@style/Widget.Mastodon.EditText</item>
|
||||||
|
|
||||||
<item name="android:buttonStyle">@style/Widget.Mastodon.M3.Button</item>
|
<item name="android:buttonStyle">@style/Widget.Mastodon.M3.Button.Filled</item>
|
||||||
<item name="android:actionBarTheme">@style/Theme.Mastodon.Toolbar</item>
|
<item name="android:actionBarTheme">@style/Theme.Mastodon.Toolbar</item>
|
||||||
<item name="android:alertDialogTheme">@style/Theme.Mastodon.Dialog.Alert</item>
|
<item name="android:alertDialogTheme">@style/Theme.Mastodon.Dialog.Alert</item>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue