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:
parent
e645e14844
commit
74e8e9de1f
3 changed files with 10 additions and 7 deletions
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
4
app/src/main/res/values/dimensions.xml
Normal file
4
app/src/main/res/values/dimensions.xml
Normal 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>
|
Loading…
Reference in a new issue