Add center view button.
This commit is contained in:
parent
826f32beca
commit
f821f49b94
@ -469,8 +469,13 @@ class CanvasView extends View implements PartGrid {
|
||||
public void setDevMode(boolean devMode) {
|
||||
_devMode = devMode;
|
||||
if (!_devMode) {
|
||||
this._viewOrigin = new Tuple2<>(0, 0);
|
||||
CenterView();
|
||||
}
|
||||
this.invalidate();
|
||||
}
|
||||
|
||||
public void CenterView() {
|
||||
this._viewOrigin = new Tuple2<>(0, 0);
|
||||
this.invalidate();
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
com.getbase.floatingactionbutton.AddFloatingActionButton AddPartButton;
|
||||
com.getbase.floatingactionbutton.FloatingActionButton SetDevModeButton;
|
||||
com.getbase.floatingactionbutton.FloatingActionButton SetUserModeButton;
|
||||
com.getbase.floatingactionbutton.FloatingActionButton CenterViewButton;
|
||||
|
||||
com.getbase.floatingactionbutton.FloatingActionsMenu devFabMenu;
|
||||
com.getbase.floatingactionbutton.FloatingActionsMenu userFabMenu;
|
||||
@ -73,6 +74,15 @@ public class MainActivity extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
|
||||
CenterViewButton = (com.getbase.floatingactionbutton.FloatingActionButton)
|
||||
findViewById(R.id.center_view_button);
|
||||
CenterViewButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
canvasView.CenterView();
|
||||
}
|
||||
});
|
||||
|
||||
SetDevModeButton = (com.getbase.floatingactionbutton.FloatingActionButton)
|
||||
findViewById(R.id.set_developer_mode_button);
|
||||
SetDevModeButton.setOnClickListener(new View.OnClickListener() {
|
||||
|
BIN
app/src/main/res/drawable-hdpi/ic_center_focus_weak_black.png
Normal file
BIN
app/src/main/res/drawable-hdpi/ic_center_focus_weak_black.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 504 B |
BIN
app/src/main/res/drawable-mdpi/ic_center_focus_weak_black.png
Normal file
BIN
app/src/main/res/drawable-mdpi/ic_center_focus_weak_black.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 341 B |
BIN
app/src/main/res/drawable-xhdpi/ic_center_focus_weak_black.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_center_focus_weak_black.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 659 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_center_focus_weak_black.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/ic_center_focus_weak_black.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 995 B |
BIN
app/src/main/res/drawable-xxxhdpi/ic_center_focus_weak_black.png
Normal file
BIN
app/src/main/res/drawable-xxxhdpi/ic_center_focus_weak_black.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
@ -93,6 +93,15 @@
|
||||
fab:fab_title="Add new part"
|
||||
fab:fab_colorPressed="@color/white_pressed"/>
|
||||
|
||||
<com.getbase.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/center_view_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
fab:fab_icon="@drawable/ic_center_focus_weak_black"
|
||||
fab:fab_colorNormal="@color/white"
|
||||
fab:fab_title="Center view"
|
||||
fab:fab_colorPressed="@color/white_pressed" />
|
||||
|
||||
<com.getbase.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/set_user_mode_button"
|
||||
android:layout_width="wrap_content"
|
||||
|
Loading…
Reference in New Issue
Block a user