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:
parent
e645e14844
commit
74e8e9de1f
3 changed files with 10 additions and 7 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -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"
|
||||||
|
|
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