mirror of
https://gitee.com/shuto/customCamera.git
synced 2026-02-16 00:00:09 +08:00
Affichage du bouton miniature en haut quand une photo est prise
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true" >
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
@@ -23,7 +22,6 @@
|
||||
android:alpha="0.2"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/normal" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<GridLayout
|
||||
@@ -33,16 +31,24 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<Button
|
||||
android:id="@+id/miniature"
|
||||
<RelativeLayout
|
||||
android:id="@+id/miniature_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:onClick="showMiniature"
|
||||
android:text="@string/miniature" />
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<Button
|
||||
android:id="@+id/miniature"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_gravity="bottom"
|
||||
android:onClick="showMiniature"
|
||||
android:text="@string/miniature" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/capture"
|
||||
@@ -67,9 +73,7 @@
|
||||
android:progressDrawable="@drawable/custom_opacity_bar"
|
||||
android:secondaryProgress="7"
|
||||
android:thumb="@drawable/thumb" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</GridLayout>
|
||||
|
||||
<GridLayout
|
||||
@@ -99,9 +103,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/declinePicture" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</GridLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -6,11 +6,12 @@
|
||||
<string name="action_settings">Settings</string>
|
||||
<string name="title_activity_camera_activity">CameraActivityNative</string>
|
||||
<string name="start_custom_camera">Start Custom Camera</string>
|
||||
<string name="capture">Capture</string>
|
||||
<string name="todo">TODO</string>
|
||||
<string name="sss">sss</string>
|
||||
<string name="miniature">Miniature</string>
|
||||
<string name="capture">Photo</string>
|
||||
<string name="BoutonMiniature">Ceci est le bouton permettant d\'afficher une miniature</string>
|
||||
<string name="descImage">Il s\'agit de l\'image de fond de l\'appareil photo</string>
|
||||
<string name="acceptePicture">Accepter Photo</string>
|
||||
<string name="declinePicture">Refuser Photo</string>
|
||||
</resources>
|
||||
|
||||
@@ -7,8 +7,6 @@ import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
@@ -29,6 +27,7 @@ import android.widget.Button;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.SeekBar.OnSeekBarChangeListener;
|
||||
|
||||
@@ -320,6 +319,7 @@ public class CameraActivity extends Activity {
|
||||
*/
|
||||
public void onPictureTaken(final byte[] data, Camera camera) {
|
||||
// Show buttons to accept or decline the picture.
|
||||
|
||||
final LinearLayout keepPhoto = (LinearLayout) findViewById(R.id.keepPhoto);
|
||||
keepPhoto.setVisibility(View.VISIBLE);
|
||||
Button accept = (Button)findViewById(R.id.accept);
|
||||
@@ -329,6 +329,13 @@ public class CameraActivity extends Activity {
|
||||
final Button photo = (Button)findViewById(R.id.capture);
|
||||
photo.setVisibility(View.INVISIBLE);
|
||||
|
||||
// Put button miniature at the top of the page
|
||||
Button miniature = (Button)findViewById(R.id.miniature);
|
||||
LayoutParams params = (RelativeLayout.LayoutParams)miniature.getLayoutParams();
|
||||
((RelativeLayout.LayoutParams) params).addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, 0);
|
||||
((RelativeLayout.LayoutParams) params).addRule(RelativeLayout.ALIGN_PARENT_TOP, RelativeLayout.TRUE);
|
||||
miniature.setLayoutParams(params);
|
||||
|
||||
// Stop link between view and camera to start the preview picture.
|
||||
mCamera.stopPreview();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user