add a Floating Action Button for creating files/directories

This commit is contained in:
tibbi 2016-07-13 23:29:39 +02:00
parent 98b4710b36
commit 25a09dbeec
8 changed files with 19 additions and 3 deletions

View File

@ -25,6 +25,7 @@ dependencies {
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.jakewharton:butterknife:8.0.1'
compile 'com.android.support:design:23.4.0'
apt 'com.jakewharton:butterknife-compiler:8.0.1'
}

View File

@ -27,6 +27,7 @@ import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class ItemsFragment extends android.support.v4.app.Fragment
implements AdapterView.OnItemClickListener, SwipeRefreshLayout.OnRefreshListener {
@ -35,6 +36,7 @@ public class ItemsFragment extends android.support.v4.app.Fragment
private List<FileDirItem> mItems;
private ItemInteractionListener mListener;
private boolean mShowHidden;
@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
public void onRefresh() {
fillItems();

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/items_holder"
<android.support.design.widget.CoordinatorLayout
android:id="@+id/item_holder"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
@ -17,4 +17,12 @@
android:clipToPadding="false"
android:paddingLeft="@dimen/activity_margin"/>
</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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B