Fix #12
This commit is contained in:
parent
351feb4fa9
commit
5fc718d28e
|
|
@ -21,6 +21,7 @@ import org.meowcat.edxposed.manager.adapters.AppHelper;
|
||||||
import org.meowcat.edxposed.manager.adapters.BlackListAdapter;
|
import org.meowcat.edxposed.manager.adapters.BlackListAdapter;
|
||||||
import org.meowcat.edxposed.manager.adapters.CompatListAdapter;
|
import org.meowcat.edxposed.manager.adapters.CompatListAdapter;
|
||||||
import org.meowcat.edxposed.manager.databinding.ActivityBlackListBinding;
|
import org.meowcat.edxposed.manager.databinding.ActivityBlackListBinding;
|
||||||
|
import org.meowcat.edxposed.manager.util.LinearLayoutManagerFix;
|
||||||
|
|
||||||
public class BlackListActivity extends BaseActivity implements AppAdapter.Callback {
|
public class BlackListActivity extends BaseActivity implements AppAdapter.Callback {
|
||||||
private SearchView searchView;
|
private SearchView searchView;
|
||||||
|
|
@ -54,7 +55,7 @@ public class BlackListActivity extends BaseActivity implements AppAdapter.Callba
|
||||||
appAdapter = isCompat ? new CompatListAdapter(this) : new BlackListAdapter(this, isWhiteListMode);
|
appAdapter = isCompat ? new CompatListAdapter(this) : new BlackListAdapter(this, isWhiteListMode);
|
||||||
appAdapter.setHasStableIds(true);
|
appAdapter.setHasStableIds(true);
|
||||||
binding.recyclerView.setAdapter(appAdapter);
|
binding.recyclerView.setAdapter(appAdapter);
|
||||||
binding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
binding.recyclerView.setLayoutManager(new LinearLayoutManagerFix(this));
|
||||||
if (!App.getPreferences().getBoolean("md2", false)) {
|
if (!App.getPreferences().getBoolean("md2", false)) {
|
||||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(this,
|
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(this,
|
||||||
DividerItemDecoration.VERTICAL);
|
DividerItemDecoration.VERTICAL);
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ import org.meowcat.edxposed.manager.databinding.ActivityDownloadBinding;
|
||||||
import org.meowcat.edxposed.manager.databinding.ItemDownloadBinding;
|
import org.meowcat.edxposed.manager.databinding.ItemDownloadBinding;
|
||||||
import org.meowcat.edxposed.manager.repo.RepoDb;
|
import org.meowcat.edxposed.manager.repo.RepoDb;
|
||||||
import org.meowcat.edxposed.manager.repo.RepoDbDefinitions;
|
import org.meowcat.edxposed.manager.repo.RepoDbDefinitions;
|
||||||
|
import org.meowcat.edxposed.manager.util.LinearLayoutManagerFix;
|
||||||
import org.meowcat.edxposed.manager.util.ModuleUtil;
|
import org.meowcat.edxposed.manager.util.ModuleUtil;
|
||||||
import org.meowcat.edxposed.manager.util.RepoLoader;
|
import org.meowcat.edxposed.manager.util.RepoLoader;
|
||||||
|
|
||||||
|
|
@ -95,7 +96,7 @@ public class DownloadActivity extends BaseActivity implements RepoLoader.RepoLis
|
||||||
moduleUtil.addListener(this);
|
moduleUtil.addListener(this);
|
||||||
binding.recyclerView.setAdapter(adapter);
|
binding.recyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
binding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
binding.recyclerView.setLayoutManager(new LinearLayoutManagerFix(this));
|
||||||
StickyRecyclerHeadersDecoration headersDecor = new StickyRecyclerHeadersDecoration(adapter);
|
StickyRecyclerHeadersDecoration headersDecor = new StickyRecyclerHeadersDecoration(adapter);
|
||||||
binding.recyclerView.addItemDecoration(headersDecor);
|
binding.recyclerView.addItemDecoration(headersDecor);
|
||||||
adapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
|
adapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import com.google.android.material.tabs.TabLayout;
|
||||||
import org.meowcat.edxposed.manager.databinding.ActivityLogsBinding;
|
import org.meowcat.edxposed.manager.databinding.ActivityLogsBinding;
|
||||||
import org.meowcat.edxposed.manager.databinding.DialogInstallWarningBinding;
|
import org.meowcat.edxposed.manager.databinding.DialogInstallWarningBinding;
|
||||||
import org.meowcat.edxposed.manager.databinding.ItemLogBinding;
|
import org.meowcat.edxposed.manager.databinding.ItemLogBinding;
|
||||||
|
import org.meowcat.edxposed.manager.util.LinearLayoutManagerFix;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
|
|
@ -78,7 +79,7 @@ public class LogsActivity extends BaseActivity {
|
||||||
}
|
}
|
||||||
adapter = new LogsAdapter();
|
adapter = new LogsAdapter();
|
||||||
binding.recyclerView.setAdapter(adapter);
|
binding.recyclerView.setAdapter(adapter);
|
||||||
binding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
binding.recyclerView.setLayoutManager(new LinearLayoutManagerFix(this));
|
||||||
if (App.getPreferences().getBoolean("disable_verbose_log", false)) {
|
if (App.getPreferences().getBoolean("disable_verbose_log", false)) {
|
||||||
binding.slidingTabs.setVisibility(View.GONE);
|
binding.slidingTabs.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import org.meowcat.edxposed.manager.adapters.AppAdapter;
|
||||||
import org.meowcat.edxposed.manager.adapters.AppHelper;
|
import org.meowcat.edxposed.manager.adapters.AppHelper;
|
||||||
import org.meowcat.edxposed.manager.adapters.ScopeAdapter;
|
import org.meowcat.edxposed.manager.adapters.ScopeAdapter;
|
||||||
import org.meowcat.edxposed.manager.databinding.ActivityScopeListBinding;
|
import org.meowcat.edxposed.manager.databinding.ActivityScopeListBinding;
|
||||||
|
import org.meowcat.edxposed.manager.util.LinearLayoutManagerFix;
|
||||||
|
|
||||||
public class ModuleScopeActivity extends BaseActivity implements AppAdapter.Callback {
|
public class ModuleScopeActivity extends BaseActivity implements AppAdapter.Callback {
|
||||||
private SearchView searchView;
|
private SearchView searchView;
|
||||||
|
|
@ -50,7 +51,7 @@ public class ModuleScopeActivity extends BaseActivity implements AppAdapter.Call
|
||||||
appAdapter = new ScopeAdapter(this, modulePackageName, binding.masterSwitch);
|
appAdapter = new ScopeAdapter(this, modulePackageName, binding.masterSwitch);
|
||||||
appAdapter.setHasStableIds(true);
|
appAdapter.setHasStableIds(true);
|
||||||
binding.recyclerView.setAdapter(appAdapter);
|
binding.recyclerView.setAdapter(appAdapter);
|
||||||
binding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
binding.recyclerView.setLayoutManager(new LinearLayoutManagerFix(this));
|
||||||
if (!App.getPreferences().getBoolean("md2", false)) {
|
if (!App.getPreferences().getBoolean("md2", false)) {
|
||||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(this,
|
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(this,
|
||||||
DividerItemDecoration.VERTICAL);
|
DividerItemDecoration.VERTICAL);
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ import org.meowcat.edxposed.manager.repo.ModuleVersion;
|
||||||
import org.meowcat.edxposed.manager.repo.ReleaseType;
|
import org.meowcat.edxposed.manager.repo.ReleaseType;
|
||||||
import org.meowcat.edxposed.manager.repo.RepoDb;
|
import org.meowcat.edxposed.manager.repo.RepoDb;
|
||||||
import org.meowcat.edxposed.manager.util.InstallApkUtil;
|
import org.meowcat.edxposed.manager.util.InstallApkUtil;
|
||||||
|
import org.meowcat.edxposed.manager.util.LinearLayoutManagerFix;
|
||||||
import org.meowcat.edxposed.manager.util.ModuleUtil;
|
import org.meowcat.edxposed.manager.util.ModuleUtil;
|
||||||
import org.meowcat.edxposed.manager.util.NavUtil;
|
import org.meowcat.edxposed.manager.util.NavUtil;
|
||||||
import org.meowcat.edxposed.manager.util.RepoLoader;
|
import org.meowcat.edxposed.manager.util.RepoLoader;
|
||||||
|
|
@ -196,7 +197,7 @@ public class ModulesActivity extends BaseActivity implements ModuleUtil.ModuleLi
|
||||||
adapter.setHasStableIds(true);
|
adapter.setHasStableIds(true);
|
||||||
moduleUtil.addListener(this);
|
moduleUtil.addListener(this);
|
||||||
binding.recyclerView.setAdapter(adapter);
|
binding.recyclerView.setAdapter(adapter);
|
||||||
binding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
binding.recyclerView.setLayoutManager(new LinearLayoutManagerFix(this));
|
||||||
if (!App.getPreferences().getBoolean("md2", false)) {
|
if (!App.getPreferences().getBoolean("md2", false)) {
|
||||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(this,
|
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(this,
|
||||||
DividerItemDecoration.VERTICAL);
|
DividerItemDecoration.VERTICAL);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
package org.meowcat.edxposed.manager.util;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
public class LinearLayoutManagerFix extends LinearLayoutManager {
|
||||||
|
public LinearLayoutManagerFix(Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LinearLayoutManagerFix(Context context, int orientation, boolean reverseLayout) {
|
||||||
|
super(context, orientation, reverseLayout);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LinearLayoutManagerFix(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||||
|
super(context, attrs, defStyleAttr, defStyleRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) {
|
||||||
|
try {
|
||||||
|
super.onLayoutChildren(recycler, state);
|
||||||
|
} catch (IndexOutOfBoundsException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue