Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
684b8794
authored
Feb 13, 2017
by
German Callejas
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Vista para Recortar modificada
parent
3eddf895
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
4 deletions
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/cropper/EditPictoActivity.java
android/Pictogram/tabletlibrary/src/main/res/layout/edit_picto_layout.xml
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/cropper/EditPictoActivity.java
View file @
684b8794
...
...
@@ -6,17 +6,22 @@ import android.content.Intent;
import
android.database.Cursor
;
import
android.graphics.Bitmap
;
import
android.graphics.BitmapFactory
;
import
android.graphics.Color
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.provider.MediaStore
;
import
android.util.DisplayMetrics
;
import
android.util.Log
;
import
android.view.KeyEvent
;
import
android.view.View
;
import
android.view.Window
;
import
android.view.inputmethod.EditorInfo
;
import
android.view.inputmethod.InputMethodManager
;
import
android.widget.Button
;
import
android.widget.EditText
;
import
android.widget.FrameLayout
;
import
android.widget.ImageButton
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
android.widget.Toast
;
...
...
@@ -47,17 +52,48 @@ public class EditPictoActivity extends Activity {
requestWindowFeature
(
Window
.
FEATURE_NO_TITLE
);
setContentView
(
R
.
layout
.
edit_picto_layout
);
DisplayMetrics
metrics
=
new
DisplayMetrics
();
getWindowManager
().
getDefaultDisplay
().
getMetrics
(
metrics
);
LinearLayout
ll
=
(
LinearLayout
)
findViewById
(
R
.
id
.
image_layout
);
Log
.
i
(
"DETALLES"
,
"Tam menu imagen: "
+
ll
.
getLayoutParams
().
width
);
ll
.
getLayoutParams
().
width
=
(
int
)
(
metrics
.
widthPixels
*
0.75
)
-
(
int
)
getResources
().
getDimension
(
R
.
dimen
.
activity_vertical_margin
);
Log
.
i
(
"DETALLES"
,
"Tam menu imagen: "
+
ll
.
getLayoutParams
().
width
);
ll
.
requestLayout
();
FrameLayout
fl
=
(
FrameLayout
)
findViewById
(
R
.
id
.
legend_menu
);
Log
.
i
(
"DETALLES"
,
"Tam menu leyenda: "
+
fl
.
getLayoutParams
().
width
);
fl
.
getLayoutParams
().
width
=
(
int
)
(
metrics
.
widthPixels
*
0.25
)
-
(
int
)
getResources
().
getDimension
(
R
.
dimen
.
activity_vertical_margin
);
Log
.
i
(
"DETALLES"
,
"Tam menu leyenda: "
+
fl
.
getLayoutParams
().
width
);
fl
.
requestLayout
();
// Initialize Views.
final
CropImageView
cropImageView
=
(
CropImageView
)
findViewById
(
R
.
id
.
CropImageView
);
final
EditText
legend
=
(
EditText
)
findViewById
(
R
.
id
.
edtLegend
);
final
ImageButton
okButton
=
(
Image
Button
)
findViewById
(
R
.
id
.
okButton
);
final
ImageButton
cancelButton
=
(
Image
Button
)
findViewById
(
R
.
id
.
cancelButton
);
final
Button
okButton
=
(
Button
)
findViewById
(
R
.
id
.
okButton
);
final
Button
cancelButton
=
(
Button
)
findViewById
(
R
.
id
.
cancelButton
);
String
transcription
=
getIntent
().
getExtras
().
getString
(
TRANSCRIPTION
);
cropImageView
.
setFixedAspectRatio
(
true
);
cropImageView
.
setGuidelines
(
2
);
cropImageView
.
setAspectRatio
(
1
,
1
);
legend
.
setOnEditorActionListener
(
new
TextView
.
OnEditorActionListener
()
{
if
(
transcription
!=
null
&&
transcription
.
length
()>
0
)
{
//Si tenia leyenda(editarlo)
legend
.
setText
(
transcription
);
}
else
{
//Si no tenia el picto leyenda
legend
.
setTextColor
(
Color
.
GRAY
);
legend
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
legend
.
setText
(
""
);
}
});
}
/*legend.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((actionId== EditorInfo.IME_ACTION_DONE ) )
...
...
@@ -72,7 +108,7 @@ public class EditPictoActivity extends Activity {
return false;
}
});
});
*/
//Obtener imagen del intent
byte
[]
byteArray
=
getIntent
().
getByteArrayExtra
(
EditPictoActivity
.
IMAGE_PICTO
);
...
...
android/Pictogram/tabletlibrary/src/main/res/layout/edit_picto_layout.xml
View file @
684b8794
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment