App

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mhr.app.fragments.toolbox.SaveImagePopUpFragment Class Reference

Fragment pro popup sloužící k uložení obrazu. More...

Inheritance diagram for mhr.app.fragments.toolbox.SaveImagePopUpFragment:

## Public Member Functions
| SaveImagePopUpFragment ()
void | onClick (View v)
void | onAttach (Activity activity)
View | onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
void | onResume ()
void | onPause ()

## Protected Member Functions
void | onActionBtn ()
| specifikuje prováděnou akci po kliknutí na pozitivní tlačítko
View | initView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
| Provede inicializaci view.
void | initItems (LayoutInflater inflater)
| Provede inicializaci ve smyslu načtení dostupných souborů a zobrazení náhledů

## Protected Attributes
View | root
AppMainActivity | activity
boolean | firstCreated = true
LinearLayout | items
String | selected = null
View | selIndicator
EditText | fnameET
TextView | captionTV
String | caption = "Some generic caption"
boolean | fnameEnabled = false
String | actionCaption = "ACTION"

## Detailed Description

Fragment pro popup sloužící k uložení obrazu.

Definition at line 9 of file SaveImagePopUpFragment.java.

## Constructor & Destructor Documentation

mhr.app.fragments.toolbox.SaveImagePopUpFragment.SaveImagePopUpFragment | ( |  | ) |
| inline

Definition at line 11 of file SaveImagePopUpFragment.java.

{
caption = "Save image";
fnameEnabled = true;
actionCaption = "Save";
}

## Member Function Documentation

void mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.initItems | ( | LayoutInflater | inflater | ) |
| inlineprotectedinherited

Provede inicializaci ve smyslu načtení dostupných souborů a zobrazení náhledů

Parameters

  inflater |

Definition at line 99 of file ImagesExplorerPopUpFragment.java.

{
items.removeAllViews();
File r = activity.getExternalFilesDir(null);
File[] files = r.listFiles();
Resources res = getResources();
int size = res.getDimensionPixelSize(R.dimen.LayerThumbSize) - 2 * res.getDimensionPixelSize(R.dimen.LayerThumbPadding);
if (files != null) {
for (File f : files ) {
if (f.isDirectory()) {
final ViewGroup v = (ViewGroup) inflater.inflate(R.layout.image_explorer_item, null);
final String fname = f.getName();
((TextView)v.findViewById(R.id.ImageNameTV)).setText(fname);
Bitmap thumb = AndroidImageFile.loadThumb(f, 200, 200);
((SimpleBitmapView)v.findViewById(R.id.ImagePreview)).setBitmap(thumb);
v.findViewById(R.id.ImagePreview).setVisibility(View.VISIBLE);
v.findViewById(R.id.ImageThumb).setVisibility(View.INVISIBLE);
v.setOnClickListener(new View.OnClickListener() {
View indicator = v.findViewById(R.id.ImageChecked);
String name = fname;
@Override
public void onClick(View v) {
if (selIndicator != null) {
selIndicator.setVisibility(View.INVISIBLE);
}
selIndicator = indicator;
indicator.setVisibility(View.VISIBLE);
selected = name;
}
});
items.addView(v);
}
}
}
}

View mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.initView | ( | LayoutInflater | inflater,
|  | ViewGroup | container,
|  | Bundle | savedInstanceState
| ) |  |
| inlineprotectedinherited

Provede inicializaci view.

Parameters

  inflater |
  container |
  savedInstanceState |

Returns

Definition at line 63 of file ImagesExplorerPopUpFragment.java.

{
root = inflater.inflate(R.layout.fragment_image_explorer_popup, container, false);
Button b = (Button) root.findViewById(R.id.ImageExplorerActionBtn);
b.setOnClickListener(this);
b.setText(actionCaption );
root.findViewById(R.id.DeleteImageBtn).setOnClickListener(this);
root.findViewById(R.id.CancelBtn).setOnClickListener(this);
fnameET = (EditText) root.findViewById(R.id.ImageExplorerFNameET);
captionTV = (TextView) root.findViewById(R.id.ImaegExplorerPopUpCaption);
if (!fnameEnabled) {
fnameET.setVisibility(View.GONE);
}
captionTV.setText(caption);
items = (LinearLayout) root.findViewById(R.id.ImageExplorerItems);
initItems(inflater);
firstCreated = false;
return root;
}

void mhr.app.fragments.toolbox.SaveImagePopUpFragment.onActionBtn | ( |  | ) |
| inlineprotectedvirtual

specifikuje prováděnou akci po kliknutí na pozitivní tlačítko

Implements mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.

Definition at line 18 of file SaveImagePopUpFragment.java.

{
String nm = fnameET.getText().toString();
if (!nm.equalsIgnoreCase("")); {
activity.getAppCore().saveToFile(AndroidImageFile.createImageFile(nm, activity));
activity.dismissDialog();
}
}

void mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.onAttach | ( | Activity | activity | ) |
| inlineinherited

Definition at line 179 of file ImagesExplorerPopUpFragment.java.

{
super.onAttach(activity);
/*
* called once the fragment is associated with its activity.
*/
this.activity = (AppMainActivity) activity;
}

void mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.onClick | ( | View | v | ) |
| inlineinherited

Definition at line 150 of file ImagesExplorerPopUpFragment.java.

{
int id = v.getId();
switch (id) {
case R.id.ImageExplorerActionBtn:
onActionBtn();
break;
case R.id.DeleteImageBtn:
if (selected != null) {
AndroidImageFile.deleteFile(selected, activity);
initItems(activity.getLayoutInflater());
} else {
return;
}
break;
case R.id.CancelBtn:
activity.dismissDialog();
break;
}
}

View mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.onCreateView | ( | LayoutInflater | inflater,
|  | ViewGroup | container,
|  | Bundle | savedInstanceState
| ) |  |
| inlineinherited

Definition at line 199 of file ImagesExplorerPopUpFragment.java.

{
/*
* creates and returns the view hierarchy associated with the fragment.
*
* The system calls this when it's time for the fragment to draw its user interface for the first time. To draw a UI for your fragment, you must return a
* View from this method that is the root of your fragment's layout. You can return null if the fragment does not provide a UI.
*
* Zde začíná životní cyklus při návratu z backstacku
*/
if (firstCreated) {
firstCreated = false;
return initView(inflater, container, savedInstanceState);
} else {
return root;
}
}

void mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.onPause | ( |  | ) |
| inlineinherited

Definition at line 249 of file ImagesExplorerPopUpFragment.java.

{
super.onPause();
/*
* fragment is no longer interacting with the user either because its activity is being paused or a fragment operation is modifying it in the activity.
*
* The system calls this method as the first indication that the user is leaving the fragment (though it does not always mean the fragment is being destroyed).
* This is usually where you should commit any changes that should be persisted beyond the current user session (because the user might not come back).
*/
}

void mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.onResume | ( |  | ) |
| inlineinherited

Definition at line 241 of file ImagesExplorerPopUpFragment.java.

{
super.onResume();
/*
* makes the fragment interacting with the user (based on its containing activity being resumed).
*/
}

## Member Data Documentation

String mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.actionCaption = "ACTION"
| protectedinherited

Definition at line 48 of file ImagesExplorerPopUpFragment.java.

AppMainActivity mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.activity
| protectedinherited

Definition at line 36 of file ImagesExplorerPopUpFragment.java.

String mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.caption = "Some generic caption"
| protectedinherited

Definition at line 46 of file ImagesExplorerPopUpFragment.java.

TextView mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.captionTV
| protectedinherited

Definition at line 44 of file ImagesExplorerPopUpFragment.java.

boolean mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.firstCreated = true
| protectedinherited

Definition at line 37 of file ImagesExplorerPopUpFragment.java.

boolean mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.fnameEnabled = false
| protectedinherited

Definition at line 47 of file ImagesExplorerPopUpFragment.java.

EditText mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.fnameET
| protectedinherited

Definition at line 43 of file ImagesExplorerPopUpFragment.java.

LinearLayout mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.items
| protectedinherited

Definition at line 39 of file ImagesExplorerPopUpFragment.java.

View mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.root
| protectedinherited

Definition at line 35 of file ImagesExplorerPopUpFragment.java.

String mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.selected = null
| protectedinherited

Definition at line 40 of file ImagesExplorerPopUpFragment.java.

View mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.selIndicator
| protectedinherited

Definition at line 41 of file ImagesExplorerPopUpFragment.java.

The documentation for this class was generated from the following file:

- /home/xxx/eclipse_workspaces/app/app/src/mhr/app/fragments/toolbox/SaveImagePopUpFragment.java