mirror of
https://github.com/TeamAmaze/AmazeFileManager.git
synced 2026-10-24 01:25:00 +08:00
Hide divider preference
This commit is contained in:
@@ -136,7 +136,7 @@ public class Main extends android.support.v4.app.Fragment {
|
||||
public CountDownTimer timer;
|
||||
private View rootView;
|
||||
public android.support.v7.widget.RecyclerView listView;
|
||||
public Boolean gobackitem,islist,showThumbs,coloriseIcons;
|
||||
public boolean gobackitem,islist,showThumbs,coloriseIcons,showDividers;
|
||||
public IconHolder ic;
|
||||
public MainActivity mainActivity;
|
||||
public boolean showButtonOnStart = false;
|
||||
@@ -191,6 +191,7 @@ public class Main extends android.support.v4.app.Fragment {
|
||||
hidemode=Sp.getInt("hidemode", 0);
|
||||
showPermissions=Sp.getBoolean("showPermissions", false);
|
||||
showSize=Sp.getBoolean("showFileSize",false);
|
||||
showDividers=Sp.getBoolean("showDividers",true);
|
||||
gobackitem=Sp.getBoolean("goBack_checkbox", false);
|
||||
circularImages=Sp.getBoolean("circularimages",true);
|
||||
showLastModified=Sp.getBoolean("showLastModified",true);
|
||||
@@ -530,7 +531,7 @@ public class Main extends android.support.v4.app.Fragment {
|
||||
listView.removeItemDecoration(headersDecor);
|
||||
addheader=true;}
|
||||
if(addheader && islist){
|
||||
dividerItemDecoration = new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST);
|
||||
dividerItemDecoration = new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST,showDividers);
|
||||
listView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
headersDecor = new StickyRecyclerHeadersDecoration(adapter);
|
||||
|
||||
@@ -96,7 +96,7 @@ public class RarViewer extends Fragment {
|
||||
LinearLayoutManager mLayoutManager;
|
||||
DividerItemDecoration dividerItemDecoration;
|
||||
|
||||
|
||||
boolean showDividers;
|
||||
public int paddingTop;
|
||||
int mToolbarHeight,hidemode;
|
||||
View mToolbarContainer;
|
||||
@@ -154,6 +154,7 @@ public class RarViewer extends Fragment {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
showSize = Sp.getBoolean("showFileSize", false);
|
||||
showLastModified = Sp.getBoolean("showLastModified", true);
|
||||
showDividers=Sp.getBoolean("showDividers",true);
|
||||
year = ("" + calendar.get(Calendar.YEAR)).substring(2, 4);
|
||||
skin = Sp.getString("skin_color", "#3f51b5");
|
||||
iconskin=Sp.getString("icon_skin_color",skin);
|
||||
@@ -402,7 +403,7 @@ String path;
|
||||
addheader=true;
|
||||
}
|
||||
if(addheader ) {
|
||||
dividerItemDecoration = new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST);
|
||||
dividerItemDecoration = new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST,showDividers);
|
||||
listView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
headersDecor = new StickyRecyclerHeadersDecoration(zipAdapter);
|
||||
|
||||
@@ -90,7 +90,7 @@ public ArrayList<ZipObj> elements = new ArrayList<ZipObj>();
|
||||
StickyRecyclerHeadersDecoration headersDecor;
|
||||
LinearLayoutManager mLayoutManager;
|
||||
DividerItemDecoration dividerItemDecoration;
|
||||
|
||||
boolean showDividers;
|
||||
public int paddingTop;
|
||||
int mToolbarHeight,hidemode;
|
||||
View mToolbarContainer;
|
||||
@@ -148,6 +148,7 @@ public ArrayList<ZipObj> elements = new ArrayList<ZipObj>();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
showSize = Sp.getBoolean("showFileSize", false);
|
||||
showLastModified = Sp.getBoolean("showLastModified", true);
|
||||
showDividers=Sp.getBoolean("showDividers",true);
|
||||
year = ("" + calendar.get(Calendar.YEAR)).substring(2, 4);
|
||||
skin = Sp.getString("skin_color", "#3f51b5");
|
||||
iconskin=Sp.getString("icon_skin_color",skin);
|
||||
@@ -383,7 +384,7 @@ public boolean cangoBack(){
|
||||
addheader=true;
|
||||
}
|
||||
if(addheader ) {
|
||||
dividerItemDecoration = new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST);
|
||||
dividerItemDecoration = new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST,showDividers);
|
||||
listView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
headersDecor = new StickyRecyclerHeadersDecoration(zipAdapter);
|
||||
|
||||
@@ -25,11 +25,13 @@ public class DividerItemDecoration extends RecyclerView.ItemDecoration {
|
||||
private Drawable mDivider;
|
||||
|
||||
private int mOrientation;
|
||||
boolean show;
|
||||
int pix=0,leftpix=0;
|
||||
public DividerItemDecoration(Context context, int orientation) {
|
||||
public DividerItemDecoration(Context context, int orientation,boolean show) {
|
||||
final TypedArray a = context.obtainStyledAttributes(ATTRS);
|
||||
mDivider = a.getDrawable(0);
|
||||
a.recycle();
|
||||
this.show=show;
|
||||
setOrientation(orientation);
|
||||
pix=(int)(16*(context.getResources().getDisplayMetrics().densityDpi/160f));
|
||||
leftpix=(int)(72*(context.getResources().getDisplayMetrics().densityDpi/160f));
|
||||
@@ -44,6 +46,7 @@ public class DividerItemDecoration extends RecyclerView.ItemDecoration {
|
||||
|
||||
@Override
|
||||
public void onDraw(Canvas c, RecyclerView parent) {
|
||||
if(!show)return;
|
||||
if (mOrientation == VERTICAL_LIST) {
|
||||
drawVertical(c, parent);
|
||||
} else {
|
||||
|
||||
@@ -71,11 +71,10 @@
|
||||
<Preference
|
||||
android:key="hidemode"
|
||||
android:title="@string/hide_mode_title" />
|
||||
<!--<SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:enabled="false"
|
||||
android:key="topfab"
|
||||
android:title="Top Fab" />-->
|
||||
<SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="showDividers"
|
||||
android:title="Show Dividers" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory android:title="@string/general">
|
||||
|
||||
Reference in New Issue
Block a user