mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-04-09 16:03:01 +02:00
add a Floating Action Button for creating files/directories
This commit is contained in:
parent
98b4710b36
commit
25a09dbeec
@ -25,6 +25,7 @@ dependencies {
|
|||||||
testCompile 'junit:junit:4.12'
|
testCompile 'junit:junit:4.12'
|
||||||
compile 'com.android.support:appcompat-v7:23.4.0'
|
compile 'com.android.support:appcompat-v7:23.4.0'
|
||||||
compile 'com.jakewharton:butterknife:8.0.1'
|
compile 'com.jakewharton:butterknife:8.0.1'
|
||||||
|
compile 'com.android.support:design:23.4.0'
|
||||||
|
|
||||||
apt 'com.jakewharton:butterknife-compiler:8.0.1'
|
apt 'com.jakewharton:butterknife-compiler:8.0.1'
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
|
import butterknife.OnClick;
|
||||||
|
|
||||||
public class ItemsFragment extends android.support.v4.app.Fragment
|
public class ItemsFragment extends android.support.v4.app.Fragment
|
||||||
implements AdapterView.OnItemClickListener, SwipeRefreshLayout.OnRefreshListener {
|
implements AdapterView.OnItemClickListener, SwipeRefreshLayout.OnRefreshListener {
|
||||||
@ -35,6 +36,7 @@ public class ItemsFragment extends android.support.v4.app.Fragment
|
|||||||
|
|
||||||
private List<FileDirItem> mItems;
|
private List<FileDirItem> mItems;
|
||||||
private ItemInteractionListener mListener;
|
private ItemInteractionListener mListener;
|
||||||
|
|
||||||
private boolean mShowHidden;
|
private boolean mShowHidden;
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@ -131,6 +133,11 @@ public class ItemsFragment extends android.support.v4.app.Fragment
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OnClick(R.id.items_fab)
|
||||||
|
public void fabClicked(View view) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRefresh() {
|
public void onRefresh() {
|
||||||
fillItems();
|
fillItems();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout
|
<android.support.design.widget.CoordinatorLayout
|
||||||
android:id="@+id/items_holder"
|
android:id="@+id/item_holder"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
@ -17,4 +17,12 @@
|
|||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:paddingLeft="@dimen/activity_margin"/>
|
android:paddingLeft="@dimen/activity_margin"/>
|
||||||
</android.support.v4.widget.SwipeRefreshLayout>
|
</android.support.v4.widget.SwipeRefreshLayout>
|
||||||
</RelativeLayout>
|
|
||||||
|
<android.support.design.widget.FloatingActionButton
|
||||||
|
android:id="@+id/items_fab"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:layout_margin="@dimen/activity_margin"
|
||||||
|
android:src="@mipmap/plus"/>
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
|
BIN
app/src/main/res/mipmap-hdpi/plus.png
Normal file
BIN
app/src/main/res/mipmap-hdpi/plus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 232 B |
BIN
app/src/main/res/mipmap-mdpi/plus.png
Normal file
BIN
app/src/main/res/mipmap-mdpi/plus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 148 B |
BIN
app/src/main/res/mipmap-xhdpi/plus.png
Normal file
BIN
app/src/main/res/mipmap-xhdpi/plus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 185 B |
BIN
app/src/main/res/mipmap-xxhdpi/plus.png
Normal file
BIN
app/src/main/res/mipmap-xxhdpi/plus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 292 B |
BIN
app/src/main/res/mipmap-xxxhdpi/plus.png
Normal file
BIN
app/src/main/res/mipmap-xxxhdpi/plus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 269 B |
Loading…
x
Reference in New Issue
Block a user