mirror of
https://github.com/olgamiller/SSTVEncoder2.git
synced 2025-12-06 06:52:01 +01:00
Added "Reset" option (to reset image position, etc.) under "Transform Image" menu item, moved "Rotate" option there
This commit is contained in:
parent
256463399a
commit
ec849bef77
|
|
@ -175,6 +175,19 @@ public class CropView extends AppCompatImageView {
|
||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void resetImage() {
|
||||||
|
if (!mImageOK)
|
||||||
|
return;
|
||||||
|
if (mOrientation == 90 || mOrientation == 270) {
|
||||||
|
int tmp = mImageWidth;
|
||||||
|
mImageWidth = mImageHeight;
|
||||||
|
mImageHeight = tmp;
|
||||||
|
}
|
||||||
|
mOrientation = 0;
|
||||||
|
resetInputRect();
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
public void setNoBitmap() {
|
public void setNoBitmap() {
|
||||||
mImageOK = false;
|
mImageOK = false;
|
||||||
mOrientation = 0;
|
mOrientation = 0;
|
||||||
|
|
|
||||||
|
|
@ -332,13 +332,16 @@ public class MainActivity extends AppCompatActivity {
|
||||||
else if (id == R.id.action_rotate) {
|
else if (id == R.id.action_rotate) {
|
||||||
mCropView.rotateImage(90);
|
mCropView.rotateImage(90);
|
||||||
}
|
}
|
||||||
|
else if (id == R.id.action_reset) {
|
||||||
|
mCropView.resetImage();
|
||||||
|
}
|
||||||
else if (id == R.id.action_privacy_policy) {
|
else if (id == R.id.action_privacy_policy) {
|
||||||
showTextPage(getString(R.string.action_privacy_policy), getString(R.string.action_privacy_policy_text));
|
showTextPage(getString(R.string.action_privacy_policy), getString(R.string.action_privacy_policy_text));
|
||||||
}
|
}
|
||||||
else if (id == R.id.action_about) {
|
else if (id == R.id.action_about) {
|
||||||
showTextPage(getString(R.string.action_about), getString(R.string.action_about_text, BuildConfig.VERSION_NAME));
|
showTextPage(getString(R.string.action_about), getString(R.string.action_about_text, BuildConfig.VERSION_NAME));
|
||||||
}
|
}
|
||||||
else if (id != R.id.action_modes) {
|
else if (id != R.id.action_modes && id != R.id.action_transform) {
|
||||||
String className = item.getIntent().getStringExtra(CLASS_NAME);
|
String className = item.getIntent().getStringExtra(CLASS_NAME);
|
||||||
setMode(className);
|
setMode(className);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,10 +30,22 @@
|
||||||
android:title="@string/action_save_wave"
|
android:title="@string/action_save_wave"
|
||||||
app:showAsAction="ifRoom"/>
|
app:showAsAction="ifRoom"/>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_rotate"
|
android:id="@+id/action_transform"
|
||||||
android:icon="@android:drawable/ic_menu_rotate"
|
android:title="@string/action_transform"
|
||||||
android:title="@string/action_rotate"
|
app:showAsAction="ifRoom">
|
||||||
app:showAsAction="ifRoom"/>
|
<menu>
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_rotate"
|
||||||
|
android:icon="@android:drawable/ic_menu_rotate"
|
||||||
|
android:title="@string/action_rotate"
|
||||||
|
app:showAsAction="ifRoom"/>
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_reset"
|
||||||
|
android:icon="@android:drawable/ic_menu_revert"
|
||||||
|
android:title="@string/action_reset"
|
||||||
|
app:showAsAction="ifRoom"/>
|
||||||
|
</menu>
|
||||||
|
</item>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_modes"
|
android:id="@+id/action_modes"
|
||||||
android:title="@string/action_modes"
|
android:title="@string/action_modes"
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,9 @@
|
||||||
<string name="action_save_wave">Save as WAVE File</string>
|
<string name="action_save_wave">Save as WAVE File</string>
|
||||||
<string name="action_stop">Stop</string>
|
<string name="action_stop">Stop</string>
|
||||||
<string name="action_play">Play</string>
|
<string name="action_play">Play</string>
|
||||||
<string name="action_rotate">Rotate Image</string>
|
<string name="action_transform">Transform Image</string>
|
||||||
|
<string name="action_rotate">Rotate</string>
|
||||||
|
<string name="action_reset">Reset</string>
|
||||||
<string name="action_done">Done</string>
|
<string name="action_done">Done</string>
|
||||||
<string name="action_modes">Modes</string>
|
<string name="action_modes">Modes</string>
|
||||||
<string name="action_martin1">Martin 1</string>
|
<string name="action_martin1">Martin 1</string>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue