mirror of
https://github.com/TeamAmaze/AmazeFileManager.git
synced 2026-10-24 09:28:22 +08:00
Many UI fixes and improvements
This commit is contained in:
@@ -4,6 +4,7 @@ import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.ColorMatrixColorFilter;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.os.Build;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
@@ -39,6 +40,7 @@ public class Recycleradapter extends RecyclerArrayAdapter<String, RecyclerView.V
|
||||
ColorMatrixColorFilter colorMatrixColorFilter;
|
||||
LayoutInflater mInflater;
|
||||
int filetype=-1;
|
||||
int item_count;
|
||||
public Recycleradapter(Main m,ArrayList<Layoutelements> items,Context context){
|
||||
this.main=m;
|
||||
this.items=items;
|
||||
@@ -49,7 +51,7 @@ public class Recycleradapter extends RecyclerArrayAdapter<String, RecyclerView.V
|
||||
colorMatrixColorFilter=main.colorMatrixColorFilter;
|
||||
mInflater = (LayoutInflater) context
|
||||
.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
|
||||
|
||||
item_count=items.size()+(main.islist?2:3);
|
||||
}
|
||||
public void toggleChecked(int position) {
|
||||
if (myChecked.get(position)) {
|
||||
@@ -155,8 +157,7 @@ public class Recycleradapter extends RecyclerArrayAdapter<String, RecyclerView.V
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
if(viewType==0){
|
||||
View v= mInflater.inflate(R.layout.rowlayout, parent, false);
|
||||
v.findViewById(R.id.icon).setVisibility(View.INVISIBLE);
|
||||
View v= mInflater.inflate(R.layout.list_footer, parent, false);
|
||||
return new ViewHolder(v);
|
||||
|
||||
}
|
||||
@@ -174,6 +175,12 @@ public class Recycleradapter extends RecyclerArrayAdapter<String, RecyclerView.V
|
||||
int i=0;
|
||||
if(main.islist){
|
||||
i=1;
|
||||
if(p1==getItemCount()-1){
|
||||
holder.rl.setMinimumHeight(main.paddingTop);
|
||||
if(item_count==2)
|
||||
holder.txtTitle.setText(R.string.nofiles);
|
||||
else holder.txtTitle.setText(R.string.guide3);
|
||||
return;}
|
||||
if(p1==0){
|
||||
holder.rl.setMinimumHeight(main.paddingTop);
|
||||
return;}}
|
||||
@@ -320,7 +327,7 @@ public class Recycleradapter extends RecyclerArrayAdapter<String, RecyclerView.V
|
||||
GradientDrawable gradientDrawable = (GradientDrawable) holder.imageView.getBackground();
|
||||
if (main.coloriseIcons) {
|
||||
if (rowItem.isDirectory(main.rootMode))
|
||||
gradientDrawable.setColor(Color.parseColor(main.iconskin));
|
||||
gradientDrawable.setColor(main.icon_skin_color);
|
||||
else if (Icons.isVideo(rowItem.getDesc()))
|
||||
gradientDrawable.setColor(Color.parseColor("#f06292"));
|
||||
else if (Icons.isAudio(rowItem.getDesc()))
|
||||
@@ -341,9 +348,9 @@ public class Recycleradapter extends RecyclerArrayAdapter<String, RecyclerView.V
|
||||
holder.imageView.setImageDrawable(null);
|
||||
}
|
||||
} else {
|
||||
gradientDrawable.setColor(Color.parseColor(main.iconskin));
|
||||
gradientDrawable.setColor(main.icon_skin_color);
|
||||
}
|
||||
} else gradientDrawable.setColor(Color.parseColor(main.iconskin));
|
||||
} else gradientDrawable.setColor((main.icon_skin_color));
|
||||
if (rowItem.getSize().equals(main.goback))
|
||||
gradientDrawable.setColor(Color.parseColor("#757575"));
|
||||
|
||||
@@ -415,7 +422,7 @@ public class Recycleradapter extends RecyclerArrayAdapter<String, RecyclerView.V
|
||||
if (main.coloriseIcons) {
|
||||
|
||||
if (rowItem.isDirectory(main.rootMode))
|
||||
holder.imageView.setColorFilter(Color.parseColor(main.skin));
|
||||
holder.imageView.setColorFilter(main.icon_skin_color);
|
||||
|
||||
else if (Icons.isVideo(rowItem.getDesc()))
|
||||
holder.imageView.setColorFilter(Color.parseColor("#f06292"));
|
||||
@@ -441,10 +448,10 @@ public class Recycleradapter extends RecyclerArrayAdapter<String, RecyclerView.V
|
||||
else if (Icons.isApk(rowItem.getDesc()) || Icons.isPicture(rowItem.getDesc()))
|
||||
holder.imageView.setColorFilter(null);
|
||||
|
||||
else holder.imageView.setColorFilter(Color.parseColor(main.skin));
|
||||
else holder.imageView.setColorFilter(main.icon_skin_color);
|
||||
|
||||
} else if (!Icons.isApk(rowItem.getDesc()) && !Icons.isPicture(rowItem.getDesc()))
|
||||
holder.imageView.setColorFilter(Color.parseColor(main.skin));
|
||||
holder.imageView.setColorFilter(main.icon_skin_color);
|
||||
else
|
||||
holder.imageView.setColorFilter(null);
|
||||
if (rowItem.getSize().equals(main.goback))
|
||||
@@ -452,7 +459,7 @@ public class Recycleradapter extends RecyclerArrayAdapter<String, RecyclerView.V
|
||||
if (checked != null) {
|
||||
|
||||
if (checked) {
|
||||
holder.imageView.setColorFilter(Color.parseColor(main.skin));
|
||||
holder.imageView.setColorFilter(main.icon_skin_color);
|
||||
holder.imageView.setImageDrawable(main.getResources().getDrawable(R.drawable.abc_ic_cab_done_holo_dark));
|
||||
holder.rl.setBackgroundColor(Color.parseColor("#9f757575"));
|
||||
} else {
|
||||
@@ -478,9 +485,9 @@ public class Recycleradapter extends RecyclerArrayAdapter<String, RecyclerView.V
|
||||
|
||||
@Override
|
||||
public long getHeaderId(int i) {
|
||||
if(i>=0 && i<items.size()+(main.islist?1:3))
|
||||
if(i>=0 && i<item_count)
|
||||
if(main.islist){
|
||||
if(i!=0){
|
||||
if(i!=0 && i!=item_count-1){
|
||||
if(items.get(i-1).getSize().equals(main.goback))return -1;
|
||||
if(items.get(i-1).isDirectory(main.rootMode))return 'D';
|
||||
else return 'F';}
|
||||
@@ -522,7 +529,7 @@ public class Recycleradapter extends RecyclerArrayAdapter<String, RecyclerView.V
|
||||
}
|
||||
|
||||
private boolean isPositionHeader(int position) {
|
||||
if(main.islist) return position == 0;
|
||||
if(main.islist) return position == 0 || position==item_count-1;
|
||||
else return position == 0 || position==1 || position==2;}
|
||||
@Override
|
||||
public void onBindHeaderViewHolder(RecyclerView.ViewHolder viewHolder, int i) {
|
||||
@@ -535,10 +542,7 @@ public class Recycleradapter extends RecyclerArrayAdapter<String, RecyclerView.V
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
if (!main.islist)
|
||||
return items.size()+3;
|
||||
else
|
||||
return items.size()+1;
|
||||
return item_count;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ import android.content.res.TypedArray;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.ColorMatrix;
|
||||
import android.graphics.ColorMatrixColorFilter;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
@@ -47,6 +48,7 @@ import android.provider.MediaStore;
|
||||
import android.support.v4.widget.SwipeRefreshLayout;
|
||||
import android.support.v7.widget.GridLayoutManager;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.view.ActionMode;
|
||||
@@ -151,6 +153,7 @@ public class Main extends android.support.v4.app.Fragment {
|
||||
public int paddingTop;
|
||||
int mToolbarHeight,hidemode;
|
||||
View mToolbarContainer;
|
||||
public int skin_color,icon_skin_color;
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -165,6 +168,8 @@ public class Main extends android.support.v4.app.Fragment {
|
||||
skin = Sp.getString("skin_color", "#3f51b5");
|
||||
fabSkin = Sp.getString("fab_skin_color", "#e91e63");
|
||||
iconskin=Sp.getString("icon_skin_color",skin);
|
||||
skin_color=Color.parseColor(skin);
|
||||
icon_skin_color=Color.parseColor(iconskin);
|
||||
sh = new Shortcuts(getActivity());
|
||||
islist = Sp.getBoolean("view", true);
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
@@ -214,7 +219,7 @@ public class Main extends android.support.v4.app.Fragment {
|
||||
} else {
|
||||
listView.setLayoutManager(mLayoutManagerGrid);
|
||||
}
|
||||
mToolbarContainer.setBackgroundColor(Color.parseColor(skin));
|
||||
mToolbarContainer.setBackgroundColor(skin_color);
|
||||
// listView.setPadding(listView.getPaddingLeft(), paddingTop, listView.getPaddingRight(), listView.getPaddingBottom());
|
||||
return rootView;
|
||||
}public int dpToPx(int dp) {
|
||||
@@ -340,6 +345,7 @@ public class Main extends android.support.v4.app.Fragment {
|
||||
}
|
||||
|
||||
});
|
||||
mSwipeRefreshLayout.setColorSchemeColors(Color.parseColor(fabSkin));
|
||||
mSwipeRefreshLayout.setProgressViewOffset(true,paddingTop,paddingTop+dpToPx(72));
|
||||
}
|
||||
|
||||
@@ -486,14 +492,7 @@ public class Main extends android.support.v4.app.Fragment {
|
||||
public void createViews(ArrayList<Layoutelements> bitmap, boolean back, File f) {
|
||||
try {
|
||||
if (bitmap != null) {
|
||||
TextView footerText = (TextView) footerView.findViewById(R.id.footerText);
|
||||
if (bitmap.size() == 0) {
|
||||
footerText.setText(res.getString(R.string.nofiles));
|
||||
// listView.addFooterView(footerView);
|
||||
} else {
|
||||
footerText.setText(res.getString(R.string.tapnhold));
|
||||
// listView.removeFooterView(footerView);
|
||||
}if(gobackitem)
|
||||
if(gobackitem)
|
||||
if (!f.getPath().equals("/")) {
|
||||
if (bitmap.size() == 0 || !bitmap.get(0).getSize().equals(goback))
|
||||
bitmap.add(0, utils.newElement(res.getDrawable(R.drawable.abc_ic_ab_back_mtrl_am_alpha), "..", "", "", goback, "", true,""));
|
||||
@@ -544,7 +543,6 @@ public class Main extends android.support.v4.app.Fragment {
|
||||
});
|
||||
if (buttons.getVisibility() == View.VISIBLE) mainActivity.bbar();
|
||||
|
||||
//mToolbarContainer.setBackgroundColor(Color.parseColor(skin));
|
||||
mainActivity.updateDrawer(current);
|
||||
mainActivity.updatepager();
|
||||
|
||||
@@ -611,7 +609,7 @@ public class Main extends android.support.v4.app.Fragment {
|
||||
/*if(Build.VERSION.SDK_INT<19)
|
||||
getActivity().findViewById(R.id.action_bar).setVisibility(View.GONE);*/
|
||||
// rootView.findViewById(R.id.buttonbarframe).setBackgroundColor(res.getColor(R.color.toolbar_cab));
|
||||
ObjectAnimator anim = ObjectAnimator.ofInt(getActivity().findViewById(R.id.buttonbarframe), "backgroundColor", Color.parseColor(skin), res.getColor(R.color.toolbar_cab));
|
||||
ObjectAnimator anim = ObjectAnimator.ofInt(getActivity().findViewById(R.id.buttonbarframe), "backgroundColor", skin_color, res.getColor(R.color.toolbar_cab));
|
||||
anim.setDuration(200);
|
||||
anim.setEvaluator(new ArgbEvaluator());
|
||||
anim.start();
|
||||
@@ -1035,7 +1033,7 @@ public class Main extends android.support.v4.app.Fragment {
|
||||
if(!results)adapter.toggleChecked(false, current);
|
||||
else adapter.toggleChecked(false);
|
||||
mainActivity.setPagingEnabled(true);
|
||||
ObjectAnimator anim = ObjectAnimator.ofInt(getActivity().findViewById(R.id.buttonbarframe), "backgroundColor", res.getColor(R.color.toolbar_cab), Color.parseColor(skin));
|
||||
ObjectAnimator anim = ObjectAnimator.ofInt(getActivity().findViewById(R.id.buttonbarframe), "backgroundColor", res.getColor(R.color.toolbar_cab), skin_color);
|
||||
anim.setDuration(50);
|
||||
anim.setEvaluator(new ArgbEvaluator());
|
||||
anim.start();
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/second"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="80dp"
|
||||
android:clickable="true"
|
||||
android:paddingTop="32dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/firstline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="?android:attr/textColorTertiary"
|
||||
android:layout_centerInParent="true"
|
||||
android:fontFamily="sans-serif-light"/>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:minHeight="48dp"
|
||||
android:id="@+id/headertext"
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<string name="stopping">Stopping</string>
|
||||
<string name="guide1">Welcome to Amaze File Manager</string>
|
||||
<string name="guide2">Touch the blue strip to show or hide PathBar</string>
|
||||
<string name="guide3">Touch and hold any file for more options...</string>
|
||||
<string name="guide3">Touch and hold any file for more options</string>
|
||||
<string name="guide4">Like copy,move,properties etc</string>
|
||||
<string name="guide5">Use Back Button of your device to exit app anytime...</string>
|
||||
<string name="guide6">..And use left arrow button for navigation in file manager</string>
|
||||
|
||||
Reference in New Issue
Block a user