Fix #43
This commit is contained in:
parent
94c864c8ac
commit
ad825d6803
|
@ -58,7 +58,7 @@ dependencies {
|
||||||
implementation 'me.grishka.litex:dynamicanimation:1.1.0-alpha03'
|
implementation 'me.grishka.litex:dynamicanimation:1.1.0-alpha03'
|
||||||
implementation 'me.grishka.litex:viewpager:1.0.0'
|
implementation 'me.grishka.litex:viewpager:1.0.0'
|
||||||
implementation 'me.grishka.litex:viewpager2:1.0.0'
|
implementation 'me.grishka.litex:viewpager2:1.0.0'
|
||||||
implementation 'me.grishka.appkit:appkit:1.2.1'
|
implementation 'me.grishka.appkit:appkit:1.2.2'
|
||||||
implementation 'com.google.code.gson:gson:2.8.9'
|
implementation 'com.google.code.gson:gson:2.8.9'
|
||||||
implementation 'org.jsoup:jsoup:1.14.3'
|
implementation 'org.jsoup:jsoup:1.14.3'
|
||||||
implementation 'com.squareup:otto:1.3.8'
|
implementation 'com.squareup:otto:1.3.8'
|
||||||
|
|
|
@ -328,7 +328,6 @@ public abstract class BaseStatusListFragment<T extends DisplayItemsParent> exten
|
||||||
public void onConfigurationChanged(Configuration newConfig){
|
public void onConfigurationChanged(Configuration newConfig){
|
||||||
super.onConfigurationChanged(newConfig);
|
super.onConfigurationChanged(newConfig);
|
||||||
updateToolbar();
|
updateToolbar();
|
||||||
list.invalidateItemDecorations();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateToolbar(){
|
private void updateToolbar(){
|
||||||
|
|
|
@ -2,12 +2,16 @@ package org.joinmastodon.android.ui;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
public class TileGridLayoutManager extends GridLayoutManager{
|
public class TileGridLayoutManager extends GridLayoutManager{
|
||||||
private static final String TAG="TileGridLayoutManager";
|
private static final String TAG="TileGridLayoutManager";
|
||||||
|
private int lastWidth=0;
|
||||||
|
|
||||||
public TileGridLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes){
|
public TileGridLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes){
|
||||||
super(context, attrs, defStyleAttr, defStyleRes);
|
super(context, attrs, defStyleAttr, defStyleRes);
|
||||||
}
|
}
|
||||||
|
@ -24,4 +28,17 @@ public class TileGridLayoutManager extends GridLayoutManager{
|
||||||
public int getColumnCountForAccessibility(RecyclerView.Recycler recycler, RecyclerView.State state){
|
public int getColumnCountForAccessibility(RecyclerView.Recycler recycler, RecyclerView.State state){
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMeasure(@NonNull RecyclerView.Recycler recycler, @NonNull RecyclerView.State state, int widthSpec, int heightSpec){
|
||||||
|
int width=View.MeasureSpec.getSize(widthSpec);
|
||||||
|
// Is there a better way to invalidate item decorations when the size changes?
|
||||||
|
if(lastWidth!=width){
|
||||||
|
lastWidth=width;
|
||||||
|
if(getChildCount()>0){
|
||||||
|
((RecyclerView)getChildAt(0).getParent()).invalidateItemDecorations();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
super.onMeasure(recycler, state, widthSpec, heightSpec);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue