add a Fab button

This commit is contained in:
tibbi 2016-08-13 17:07:03 +02:00
parent ac3492880d
commit 9eef8a5c55
8 changed files with 13 additions and 3 deletions

View File

@ -29,6 +29,7 @@ dependencies {
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}

View File

@ -27,6 +27,7 @@ class MainActivity : SimpleActivity() {
startActivity(viewIntent("https://play.google.com/store/apps/details?id=" + it.pkgName))
}
}
fab.setOnClickListener { }
}
override fun onCreateOptionsMenu(menu: Menu?): Boolean {

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/grid_holder"
<android.support.design.widget.CoordinatorLayout
android:id="@+id/coordinator_layout"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
@ -16,4 +16,12 @@
app:layoutManager="android.support.v7.widget.GridLayoutManager"
app:spanCount="@integer/columns"/>
</RelativeLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/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