1
0
Fork 0
mirror of https://github.com/vanitasvitae/Spherical synced 2024-11-22 04:12:07 +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 @Override
public void onClick(View v) { public void onClick(View v) {
SphereSurfaceView.USE_TOUCH = !SphereSurfaceView.USE_TOUCH; SphereSurfaceView.USE_TOUCH = !SphereSurfaceView.USE_TOUCH;
fab.hide(); fab.setVisibility(View.INVISIBLE);
} }
}); });
fab.hide();
// Detect gestures like single taps. // Detect gestures like single taps.
final GestureDetector mGesDetect = new GestureDetector(this, new GestureDetector.SimpleOnGestureListener() { final GestureDetector gestureDetector = new GestureDetector(this, new GestureDetector.SimpleOnGestureListener() {
@Override @Override
public boolean onSingleTapConfirmed(MotionEvent event) { public boolean onSingleTapConfirmed(MotionEvent event) {
if (fab.isShown()) { if (fab.isShown()) {
fab.hide(); fab.setVisibility(View.INVISIBLE);
} else { } else {
fab.show(); fab.show();
} }
return true; return true;
} }
}); });
surfaceView.setOnTouchListener(new View.OnTouchListener() { surfaceView.setOnTouchListener(new View.OnTouchListener() {
@Override @Override
public boolean onTouch(View v, MotionEvent event) { 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.support.design.widget.FloatingActionButton
android:id="@+id/fab" android:id="@+id/fab"
android:src="@drawable/ic_explore_white_48px" android:src="@drawable/ic_explore_white_48px"
app:fabSize="auto" app:fabSize="mini"
android:layout_gravity="bottom|end" android:layout_gravity="bottom|end"
android:layout_margin="16dp" android:layout_margin="16dp"
android:layout_width="wrap_content" 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>