fullscreen plot added
This commit is contained in:
parent
e2fdfd553f
commit
61a405de10
@ -355,6 +355,7 @@
|
|||||||
<string name="cpp_plot_empty_function_error">Unable to plot empty function!</string>
|
<string name="cpp_plot_empty_function_error">Unable to plot empty function!</string>
|
||||||
<string name="cpp_plot_too_many_variables">Unable to plot: too many variables!</string>
|
<string name="cpp_plot_too_many_variables">Unable to plot: too many variables!</string>
|
||||||
<string name="cpp_plot_range">Graph range</string>
|
<string name="cpp_plot_range">Graph range</string>
|
||||||
|
<string name="cpp_plot_fullscreen">Fullscreen plot</string>
|
||||||
<string name="cpp_plot_range_x_min">X Min</string>
|
<string name="cpp_plot_range_x_min">X Min</string>
|
||||||
<string name="cpp_plot_range_x_max">X Max</string>
|
<string name="cpp_plot_range_x_max">X Max</string>
|
||||||
<string name="cpp_plot_range_y_min">Y Min</string>
|
<string name="cpp_plot_range_y_min">Y Min</string>
|
||||||
|
@ -20,6 +20,12 @@
|
|||||||
a:icon="@drawable/kb_stats"
|
a:icon="@drawable/kb_stats"
|
||||||
a:showAsAction="always" />
|
a:showAsAction="always" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
a:id="@+id/menu_plot_fullscreen"
|
||||||
|
a:title="@string/cpp_plot_fullscreen"
|
||||||
|
a:icon="@drawable/kb_expand"
|
||||||
|
a:showAsAction="always" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
a:id="@+id/menu_plot_range"
|
a:id="@+id/menu_plot_range"
|
||||||
a:title="@string/cpp_plot_range"
|
a:title="@string/cpp_plot_range"
|
||||||
|
@ -260,6 +260,22 @@ public abstract class AbstractCalculatorPlotFragment extends CalculatorFragment
|
|||||||
};
|
};
|
||||||
menuItems.add(plot2dMenuItem);
|
menuItems.add(plot2dMenuItem);
|
||||||
|
|
||||||
|
final IdentifiableMenuItem<MenuItem> fullscreenPlotMenuItem = new IdentifiableMenuItem<MenuItem>() {
|
||||||
|
@Nonnull
|
||||||
|
@Override
|
||||||
|
public Integer getItemId() {
|
||||||
|
return R.id.menu_plot_fullscreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(@Nonnull MenuItem data, @Nonnull Context context) {
|
||||||
|
savePlotBoundaries();
|
||||||
|
|
||||||
|
context.startActivity(new Intent(context, CalculatorPlotActivity.class));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
menuItems.add(fullscreenPlotMenuItem);
|
||||||
|
|
||||||
final IdentifiableMenuItem<MenuItem> captureScreenshotMenuItem = new IdentifiableMenuItem<MenuItem>() {
|
final IdentifiableMenuItem<MenuItem> captureScreenshotMenuItem = new IdentifiableMenuItem<MenuItem>() {
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
@ -278,6 +294,7 @@ public abstract class AbstractCalculatorPlotFragment extends CalculatorFragment
|
|||||||
final boolean plot3dVisible = !plotData.isPlot3d() && is3dPlotSupported();
|
final boolean plot3dVisible = !plotData.isPlot3d() && is3dPlotSupported();
|
||||||
final boolean plot2dVisible = plotData.isPlot3d() && Locator.getInstance().getPlotter().is2dPlotPossible();
|
final boolean plot2dVisible = plotData.isPlot3d() && Locator.getInstance().getPlotter().is2dPlotPossible();
|
||||||
final boolean captureScreenshotVisible = isScreenshotSupported();
|
final boolean captureScreenshotVisible = isScreenshotSupported();
|
||||||
|
final boolean fullscreenVisible = isPaneFragment();
|
||||||
fragmentMenu = ListActivityMenu.fromResource(R.menu.plot_menu, menuItems, SherlockMenuHelper.getInstance(), new JPredicate<AMenuItem<MenuItem>>() {
|
fragmentMenu = ListActivityMenu.fromResource(R.menu.plot_menu, menuItems, SherlockMenuHelper.getInstance(), new JPredicate<AMenuItem<MenuItem>>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(@Nullable AMenuItem<MenuItem> menuItem) {
|
public boolean apply(@Nullable AMenuItem<MenuItem> menuItem) {
|
||||||
@ -289,6 +306,8 @@ public abstract class AbstractCalculatorPlotFragment extends CalculatorFragment
|
|||||||
return !captureScreenshotVisible;
|
return !captureScreenshotVisible;
|
||||||
} else if (menuItem == plotRangeMenuItem) {
|
} else if (menuItem == plotRangeMenuItem) {
|
||||||
return !plotRangeVisible;
|
return !plotRangeVisible;
|
||||||
|
} else if (menuItem == fullscreenPlotMenuItem) {
|
||||||
|
return !fullscreenVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user