1
0
Fork 0
mirror of https://github.com/vanitasvitae/Spherical synced 2024-12-22 02:48:00 +01:00

Fix #11, make FAB bigger

This commit is contained in:
vanitasvitae 2017-09-14 13:16:25 +02:00
parent e645e14844
commit 74e8e9de1f
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
3 changed files with 10 additions and 7 deletions

View file

@ -49,29 +49,28 @@ public class MainActivity extends AppCompatActivity {
@Override
public void onClick(View v) {
SphereSurfaceView.USE_TOUCH = !SphereSurfaceView.USE_TOUCH;
fab.hide();
fab.setVisibility(View.INVISIBLE);
}
});
fab.hide();
// Detect gestures like single taps.
final GestureDetector mGesDetect = new GestureDetector(this, new GestureDetector.SimpleOnGestureListener() {
final GestureDetector gestureDetector = new GestureDetector(this, new GestureDetector.SimpleOnGestureListener() {
@Override
public boolean onSingleTapConfirmed(MotionEvent event) {
if (fab.isShown()) {
fab.hide();
fab.setVisibility(View.INVISIBLE);
} else {
fab.show();
}
return true;
}
});
surfaceView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
return mGesDetect.onTouchEvent(event);
return gestureDetector.onTouchEvent(event);
}
});

View file

@ -18,7 +18,7 @@
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:src="@drawable/ic_explore_white_48px"
app:fabSize="auto"
app:fabSize="mini"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:layout_width="wrap_content"

View file

@ -0,0 +1,4 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<dimen name="design_fab_size_mini" tools:override="true">64dp</dimen>
<dimen name="design_fab_image_size" tools:override="true">48dp</dimen>
</resources>