9
0
mirror of https://gitee.com/shuto/customCamera.git synced 2026-05-02 00:07:24 +08:00

Change operation with miniature. Use only the button to minimize or maximize the picture.

This commit is contained in:
Christophe BOUCAUT
2015-06-04 12:16:46 +02:00
parent 0f74460bf2
commit 33be9e6b87
2 changed files with 19 additions and 25 deletions
@@ -15,6 +15,13 @@
android:layout_width="fill_parent"
android:layout_height="match_parent" />
<ImageView
android:id="@+id/background"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:alpha="0.2"
android:scaleType="fitXY" />
<LinearLayout
android:id="@+id/actionBar"
android:layout_width="fill_parent"
@@ -69,13 +76,6 @@
android:src="@drawable/flash" />
</LinearLayout>
<ImageView
android:id="@+id/background"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:alpha="0.2"
android:scaleType="fitXY" />
<LinearLayout
android:id="@+id/beforePhoto"
@@ -519,25 +519,19 @@ public class CameraActivity extends Activity {
*/
public void buttonMiniature(View view) {
ImageView background = (ImageView) findViewById(R.id.background);
final ImageButton miniature = (ImageButton) view;
ImageButton miniature = (ImageButton) view;
modeMiniature = true;
// Set new size for miniature layout.
setParamsMiniature(background, true);
// Hide the miniature button.
miniature.setVisibility(View.GONE);
// Add event on click action for the miniature picture.
background.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
modeMiniature = false;
ImageView background = (ImageView) view;
// Resize miniature.
background.setClickable(false);
setBackground();
miniature.setVisibility(View.VISIBLE);
}
});
if (modeMiniature) {
modeMiniature = false;
miniature.setImageResource(R.drawable.minimise);
// Reset the default position and size for the background.
setBackground();
} else {
modeMiniature = true;
miniature.setImageResource(R.drawable.maximise);
// Set new size for miniature layout.
setParamsMiniature(background, true);
}
}
/**