mirror of
https://github.com/TeamAmaze/AmazeFileManager.git
synced 2026-10-23 08:49:18 +08:00
Revert "Revert "Revert "Fully removed card ui"""
This reverts commit 171a45ee90.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_pressed="true" android:drawable="@color/safrs" />
|
||||
<item android:state_focused="true" android:drawable="@color/safrs" />
|
||||
<item
|
||||
|
||||
android:drawable="@drawable/bg_card" />
|
||||
</selector>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true" android:drawable="@drawable/bg_card_pressed" />
|
||||
|
||||
<item android:drawable="@drawable/card" />
|
||||
</selector>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#CABBBBBB" />
|
||||
<corners android:radius="1dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item
|
||||
android:left="0.5dp"
|
||||
android:right="0.5dp"
|
||||
android:top="0dp"
|
||||
android:bottom="2dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#ffffff" />
|
||||
<corners android:radius="0dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#CABBBBBB" />
|
||||
<corners android:radius="1dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item
|
||||
android:left="0dp"
|
||||
android:right="0dp"
|
||||
android:top="0dp"
|
||||
android:bottom="2dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/holo" />
|
||||
<corners android:radius="1dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -15,6 +15,13 @@
|
||||
android:key="viewmode"
|
||||
android:summary="Choose ListView Mode"
|
||||
android:title="@string/viewmode" />
|
||||
<ListPreference
|
||||
android:defaultValue="0"
|
||||
android:entries="@array/uimode"
|
||||
android:entryValues="@array/ints"
|
||||
android:key="uimode"
|
||||
android:summary="Choose Item Ui"
|
||||
android:title="@string/uimode" />
|
||||
<ListPreference
|
||||
android:defaultValue="0"
|
||||
android:entries="@array/directorysortmode"
|
||||
|
||||
@@ -163,8 +163,11 @@ public class AppsAdapter extends ArrayAdapter<Layoutelements> {
|
||||
if (checked) {
|
||||
holder.rl.setBackgroundColor(Color.parseColor("#5f33b5e5"));
|
||||
} else {
|
||||
if (app.uimode == 0) {
|
||||
holder.rl.setBackgroundResource(R.drawable.listitem1);
|
||||
|
||||
} else if (app.uimode == 1) {
|
||||
holder.rl.setBackgroundResource(R.drawable.bg_card);
|
||||
}
|
||||
}
|
||||
}
|
||||
return view;
|
||||
|
||||
@@ -165,7 +165,7 @@ public class IAdapter extends ArrayAdapter<Layoutelements> {
|
||||
holder.r.setBackgroundColor(Color.parseColor("#9f33b5e5"));
|
||||
} else {
|
||||
if (frag.theme == 0) {
|
||||
holder.r.setBackgroundResource(R.drawable.listitem1);
|
||||
holder.r.setBackgroundResource(R.drawable.bg_card);
|
||||
} else {
|
||||
holder.album.setBackgroundColor(Color.parseColor("#70000000"));
|
||||
holder.iname.setBackgroundColor(Color.parseColor("#70000000"));
|
||||
|
||||
@@ -134,9 +134,11 @@ public class MyAdapter extends ArrayAdapter<Layoutelements> {
|
||||
if (checked) {
|
||||
holder.rl.setBackgroundColor(Color.parseColor("#5fcccccc"));
|
||||
} else {
|
||||
|
||||
if (main.uimode == 0) {
|
||||
holder.rl.setBackgroundResource(R.drawable.listitem1);
|
||||
|
||||
} else if (main.uimode == 1) {
|
||||
holder.rl.setBackgroundResource(R.drawable.bg_card);
|
||||
}
|
||||
}
|
||||
}
|
||||
holder.rl.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@@ -45,6 +45,7 @@ public class AppsList extends ListFragment {
|
||||
Futils utils = new Futils();
|
||||
AppsList app = this;
|
||||
AppsAdapter adapter;
|
||||
public int uimode;
|
||||
SharedPreferences Sp;
|
||||
public boolean selection = false;
|
||||
public ActionMode mActionMode;
|
||||
@@ -61,8 +62,23 @@ public class AppsList extends ListFragment {
|
||||
|
||||
};
|
||||
Sp = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
||||
uimode = Integer.parseInt(Sp.getString("uimode", "0"));
|
||||
ListView vl = getListView();
|
||||
|
||||
if (uimode == 1) {
|
||||
float scale = getResources().getDisplayMetrics().density;
|
||||
int dpAsPixels = (int) (10 * scale + 0.5f);
|
||||
vl.setPadding(dpAsPixels, 0, dpAsPixels, 0);
|
||||
vl.setDivider(null);
|
||||
vl.setDividerHeight(dpAsPixels);
|
||||
View divider = getActivity().getLayoutInflater().inflate(R.layout.divider, null);
|
||||
vl.addFooterView(divider);
|
||||
vl.addHeaderView(divider);
|
||||
vl.setCacheColorHint(android.R.color.transparent);
|
||||
vl.setSelector(android.R.color.transparent);
|
||||
vl.setHeaderDividersEnabled(true);
|
||||
vl.setFooterDividersEnabled(true);
|
||||
}
|
||||
// vl.setScrollBarStyle(ListView.SCROLLBARS_OUTSIDE_INSET);
|
||||
vl.setFastScrollEnabled(true);
|
||||
new LoadListTask().execute();
|
||||
}
|
||||
|
||||
@@ -82,6 +82,7 @@ public class Main extends ListFragment {
|
||||
Resources res;
|
||||
public LinearLayout buttons;
|
||||
public int sortby, dsort, asc;
|
||||
public int uimode;
|
||||
ArrayList<String> COPY_PATH = null, MOVE_PATH = null;
|
||||
public String home, current = Environment.getExternalStorageDirectory().getPath(), sdetails;
|
||||
Shortcuts sh = new Shortcuts();
|
||||
@@ -90,17 +91,26 @@ public class Main extends ListFragment {
|
||||
public HistoryManager history;
|
||||
IconUtils icons;
|
||||
HorizontalScrollView scroll;
|
||||
ProgressBar p;
|
||||
public boolean rootMode, mountSystem;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.mainlist,
|
||||
container, false);
|
||||
history = new HistoryManager(getActivity(), "Table1");
|
||||
p = (ProgressBar) rootView.findViewById(R.id.progressBar);
|
||||
Sp = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
||||
icons = new IconUtils(Sp, getActivity());
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
setHasOptionsMenu(true);
|
||||
utils = new Futils();
|
||||
history = new HistoryManager(getActivity(), "Table1");
|
||||
Sp = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
||||
icons = new IconUtils(Sp, getActivity());
|
||||
res = getResources();
|
||||
rootMode = Sp.getBoolean("rootmode", false);
|
||||
mountSystem = Sp.getBoolean("mountsystem", false);
|
||||
@@ -138,7 +148,18 @@ public class Main extends ListFragment {
|
||||
File f = new File(home);
|
||||
buttons = (LinearLayout) getActivity().findViewById(R.id.buttons);
|
||||
scroll = (HorizontalScrollView) getActivity().findViewById(R.id.scroll);
|
||||
uimode = Integer.parseInt(Sp.getString("uimode", "0"));
|
||||
ListView vl = getListView();
|
||||
if (uimode == 1) {
|
||||
float scale = getResources().getDisplayMetrics().density;
|
||||
int dpAsPixels = (int) (5 * scale + 0.5f);
|
||||
vl.setPadding(dpAsPixels, 0, dpAsPixels, 0);
|
||||
View divider = getActivity().getLayoutInflater().inflate(R.layout.divider, null);
|
||||
vl.setDivider(null);
|
||||
vl.setDividerHeight(dpAsPixels);
|
||||
vl.addFooterView(divider);
|
||||
vl.addHeaderView(divider);
|
||||
}
|
||||
vl.setFastScrollEnabled(true);
|
||||
if (savedInstanceState == null)
|
||||
loadlist(f, false);
|
||||
@@ -502,6 +523,7 @@ public class Main extends ListFragment {
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
p.setVisibility(View.GONE);
|
||||
getListView().setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,13 +26,23 @@ public class Preffrag extends PreferenceFragment {
|
||||
|
||||
final SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
||||
final EditTextPreference b = (EditTextPreference) findPreference("Ipath");
|
||||
|
||||
final ListPreference ui = (ListPreference) findPreference("uimode");
|
||||
int vl = Integer.parseInt(sharedPref.getString("theme", "0"));
|
||||
if (vl == 1) {
|
||||
ui.setEnabled(false);
|
||||
}
|
||||
ListPreference th = (ListPreference) findPreference("theme");
|
||||
th.setOnPreferenceChangeListener(new ListPreference.OnPreferenceChangeListener() {
|
||||
|
||||
public boolean onPreferenceChange(Preference p1, Object p2) {
|
||||
int value = Integer.parseInt(sharedPref.getString("theme", "0"));
|
||||
|
||||
if (value == 0) {
|
||||
sharedPref.edit().putString("uimode", "0").commit();
|
||||
ui.setEnabled(false);
|
||||
} else {
|
||||
ui.setEnabled(true);
|
||||
}
|
||||
restartPC(getActivity());
|
||||
// TODO: Implement this method
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user