App
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment Class Referenceabstract

Fragment, který slouží k procházení obrazů, které uživatel uložil - umožňuje mazat, akci implementují odvozené třídy. More...

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

Public Member Functions

void onClick (View v)
 
void onAttach (Activity activity)
 
View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
 
void onResume ()
 
void onPause ()
 

Protected Member Functions

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ů
 
abstract void onActionBtn ()
 specifikuje prováděnou akci po kliknutí na pozitivní tlačítko
 

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, který slouží k procházení obrazů, které uživatel uložil - umožňuje mazat, akci implementují odvozené třídy.

Definition at line 27 of file ImagesExplorerPopUpFragment.java.

Member Function Documentation

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

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 
)
inlineprotected

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;
}
abstract void mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.onActionBtn ( )
protectedpure virtual

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

Implemented in mhr.app.fragments.toolbox.SaveImagePopUpFragment, and mhr.app.fragments.toolbox.OpenImagePopUpFragment.

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

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)
inline

Definition at line 150 of file ImagesExplorerPopUpFragment.java.

{
int id = v.getId();
switch (id) {
case R.id.ImageExplorerActionBtn:
break;
case R.id.DeleteImageBtn:
if (selected != null) {
AndroidImageFile.deleteFile(selected, activity);
initItems(activity.getLayoutInflater());
} else {
return;
}
break;
case R.id.CancelBtn:
break;
}
}
View mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.onCreateView ( LayoutInflater  inflater,
ViewGroup  container,
Bundle  savedInstanceState 
)
inline

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 ( )
inline

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 ( )
inline

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"
protected

Definition at line 48 of file ImagesExplorerPopUpFragment.java.

AppMainActivity mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.activity
protected

Definition at line 36 of file ImagesExplorerPopUpFragment.java.

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

Definition at line 46 of file ImagesExplorerPopUpFragment.java.

TextView mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.captionTV
protected

Definition at line 44 of file ImagesExplorerPopUpFragment.java.

boolean mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.firstCreated = true
protected

Definition at line 37 of file ImagesExplorerPopUpFragment.java.

boolean mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.fnameEnabled = false
protected

Definition at line 47 of file ImagesExplorerPopUpFragment.java.

EditText mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.fnameET
protected

Definition at line 43 of file ImagesExplorerPopUpFragment.java.

LinearLayout mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.items
protected

Definition at line 39 of file ImagesExplorerPopUpFragment.java.

View mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.root
protected

Definition at line 35 of file ImagesExplorerPopUpFragment.java.

String mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.selected = null
protected

Definition at line 40 of file ImagesExplorerPopUpFragment.java.

View mhr.app.fragments.toolbox.ImagesExplorerPopUpFragment.selIndicator
protected

Definition at line 41 of file ImagesExplorerPopUpFragment.java.


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