Scroll fragments to top from the tab bar

This commit is contained in:
Grishka
2022-02-22 03:07:10 +03:00
parent f4e71cf130
commit d25b7e67b8
7 changed files with 45 additions and 27 deletions

View File

@@ -123,7 +123,7 @@ public class PhotoLayoutHelper{
};
}
}else if(cnt==4){
if(/*(ratios.get(0) > 1.2 * maxRatio || avgRatio > 1.5 * maxRatio) &&*/ orients.equals("wwww")){ // 2nd, 3rd and 4th photos are on the next line
if(/*(ratios.get(0) > 1.2 * maxRatio || avgRatio > 1.5 * maxRatio) &&*/ orients.equals("wwww") || true /* temporary fix */){ // 2nd, 3rd and 4th photos are on the next line
float hCover=Math.min(maxW/ratios.get(0), (maxH-marginH)*0.66f);
float h=(maxW-2*marginW)/(ratios.get(1)+ratios.get(2)+ratios.get(3));
float w0=h*ratios.get(1);

View File

@@ -43,12 +43,12 @@ public class TabBar extends LinearLayout{
}
private void onChildClick(View v){
listener.accept(selectedTabID);
if(v.getId()==selectedTabID)
return;
findViewById(selectedTabID).setSelected(false);
v.setSelected(true);
selectedTabID=v.getId();
listener.accept(selectedTabID);
}
public void setListener(IntConsumer listener){