source: dispositivos_moviles/TibisayMovil/src/ve/gob/cenditel/tibisaymovil/SignResultHandwrittenSignatureActivity.java @ 6f9915f

Last change on this file since 6f9915f was ca6582b, checked in by Antonio Araujo Brett <aaraujo@…>, 11 years ago

Corrección de error en layout de resultado de firma manuscrita sobre archivo pdf.

  • Property mode set to 100644
File size: 3.3 KB
Line 
1package ve.gob.cenditel.tibisaymovil;
2
3
4import java.io.File;
5
6import android.app.Activity;
7import android.content.Intent;
8import android.net.Uri;
9import android.os.Bundle;
10import android.util.Log;
11import android.view.View;
12import android.view.View.OnClickListener;
13import android.view.Window;
14import android.widget.LinearLayout;
15import android.widget.TextView;
16import android.widget.Toast;
17
18public class SignResultHandwrittenSignatureActivity extends Activity{
19    private String fileToSign;
20    private String imageCaptured;
21    private String fileSigned;
22    private String pathFileSigned;
23    private LinearLayout button_share;
24    private LinearLayout button_finish;
25       
26        @Override               
27        protected void onCreate(Bundle savedInstanceState) {
28                       
29        //Capturando archivo que será firmado
30        fileToSign = getIntent().getExtras().getString("FILE_TO_SIGN");
31        //Capturando imagen de firma
32        imageCaptured = getIntent().getExtras().getString("IMAGE_CAPTURED");
33        //Capturando archivo firmado
34        fileSigned = getIntent().getExtras().getString("FILE_SIGNED");
35        pathFileSigned = getIntent().getExtras().getString("PATH_FILE_SIGNED");
36               
37                //Estilando la barra de titulo
38                final boolean customTitleSupported = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
39       
40                super.onCreate(savedInstanceState);
41        setContentView(R.layout.activity_sign_result_handwritten_signature);
42            //Estilando Barra de titulo
43                if(customTitleSupported)
44                        getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title_bar);
45
46        TextView archivo_para_firm = (TextView) this.findViewById(R.id.archivo_original_a_firmar);
47        TextView imagen_utlizada= (TextView) this.findViewById(R.id.archivo_descifrado);
48        TextView archivo_firmado = (TextView) this.findViewById(R.id.destinatario);
49
50        archivo_para_firm.setText(fileToSign);
51        imagen_utlizada.setText(imageCaptured);
52        archivo_firmado.setText(pathFileSigned+fileSigned);
53
54        button_share = (LinearLayout) this.findViewById(R.id.button_remove_certificate_zone);
55        button_finish = (LinearLayout) this.findViewById(R.id.button_add_certificate_zone);         
56       
57               
58       
59        button_finish.setOnClickListener(new OnClickListener() 
60        {       
61            public void onClick(View v) 
62            {
63                Intent oIntent = new Intent(SignResultHandwrittenSignatureActivity.this, TibisayMovilActivity.class);
64                        oIntent.setAction(Intent.ACTION_VIEW);
65                        oIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
66                        startActivity(oIntent);
67                        finish();
68            }
69        });
70       
71        button_share.setOnClickListener(new OnClickListener() 
72        {       
73            public void onClick(View v) 
74            {
75                shareIt();
76            }
77        });
78        }
79       
80        private void shareIt() {
81               
82                Intent shareIntent = new Intent();
83                shareIntent.setAction(Intent.ACTION_SEND);
84                Toast.makeText(SignResultHandwrittenSignatureActivity.this,pathFileSigned + fileSigned,Toast.LENGTH_LONG).show();
85                File file = new File(pathFileSigned + fileSigned);
86                Uri pdf_uri = Uri.fromFile(file);
87                Log.i("DEBUG", file.getPath());
88                shareIntent.putExtra(Intent.EXTRA_STREAM, pdf_uri);
89                shareIntent.setType("application/pdf ");
90                startActivity(Intent.createChooser(shareIntent, "Compartir pdf usando"));
91        }
92}
Note: See TracBrowser for help on using the repository browser.