com.example.anna.phototag

## Class EditTag

- java.lang.Object
- - android.content.Context
  - - android.content.ContextWrapper
    - - android.view.ContextThemeWrapper
      - - android.app.Activity
        - - android.support.v4.app.FragmentActivity
          - - android.support.v7.app.ActionBarActivity
            - - com.example.anna.phototag.EditTag

- All Implemented Interfaces:
    android.content.ComponentCallbacks, android.content.ComponentCallbacks2, android.support.v4.app.ActionBarDrawerToggle.DelegateProvider, android.support.v4.app.TaskStackBuilder.SupportParentable, android.view.KeyEvent.Callback, android.view.LayoutInflater.Factory, android.view.LayoutInflater.Factory2, android.view.View.OnCreateContextMenuListener, android.view.Window.Callback, android.view.Window.OnWindowDismissedCallback, NavigationDrawerFragmentEdit.NavigationDrawerCallbacks, java.io.Serializable

      public class EditTag
      extends android.support.v7.app.ActionBarActivity
      implements NavigationDrawerFragmentEdit.NavigationDrawerCallbacks, java.io.Serializable

  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `EditTag.PlaceholderFragment` A placeholder fragment containing a simple view.

    - ### Nested classes/interfaces inherited from class android.app.Activity

      `android.app.Activity.TranslucentConversionListener`

    - ### Nested classes/interfaces inherited from class android.content.Context

      `android.content.Context.BindServiceFlags, android.content.Context.CreatePackageOptions, android.content.Context.ServiceName`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `area`
    `protected android.widget.ImageView` | `image`
    `protected java.util.ArrayList<LayerParent>` | `layers`
    `protected android.view.Menu` | `mToolbarMenu`
    `protected java.lang.String` | `nameFile`
    `protected java.lang.String` | `path`
    `protected boolean` | `punt`
    `protected android.net.Uri` | `uri`

    - ### Fields inherited from class android.app.Activity

      `DEFAULT_KEYS_DIALER, DEFAULT_KEYS_DISABLE, DEFAULT_KEYS_SEARCH_GLOBAL, DEFAULT_KEYS_SEARCH_LOCAL, DEFAULT_KEYS_SHORTCUT, FOCUSED_STATE_SET, RESULT_CANCELED, RESULT_FIRST_USER, RESULT_OK`

    - ### Fields inherited from class android.content.Context

      `ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, APP_OPS_SERVICE, APPWIDGET_SERVICE, AUDIO_SERVICE, BACKUP_SERVICE, BATTERY_SERVICE, BIND_ABOVE_CLIENT, BIND_ADJUST_WITH_ACTIVITY, BIND_ALLOW_OOM_MANAGEMENT, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_IMPORTANT, BIND_NOT_FOREGROUND, BIND_NOT_VISIBLE, BIND_SHOWING_UI, BIND_TREAT_LIKE_ACTIVITY, BIND_VISIBLE, BIND_WAIVE_PRIORITY, BLUETOOTH_SERVICE, CAMERA_SERVICE, CAPTIONING_SERVICE, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONSUMER_IR_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_REGISTER_PACKAGE, CONTEXT_RESTRICTED, COUNTRY_DETECTOR, DEVICE_POLICY_SERVICE, DISPLAY_SERVICE, DOWNLOAD_SERVICE, DROPBOX_SERVICE, ETHERNET_SERVICE, FINGERPRINT_SERVICE, HDMI_CONTROL_SERVICE, INPUT_METHOD_SERVICE, INPUT_SERVICE, JOB_SCHEDULER_SERVICE, KEYGUARD_SERVICE, LAUNCHER_APPS_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MEDIA_PROJECTION_SERVICE, MEDIA_ROUTER_SERVICE, MEDIA_SESSION_SERVICE, MODE_APPEND, MODE_ENABLE_WRITE_AHEAD_LOGGING, MODE_MULTI_PROCESS, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NETWORK_POLICY_SERVICE, NETWORK_SCORE_SERVICE, NETWORK_STATS_SERVICE, NETWORKMANAGEMENT_SERVICE, NFC_SERVICE, NOTIFICATION_SERVICE, NSD_SERVICE, PERSISTENT_DATA_BLOCK_SERVICE, POWER_SERVICE, PRINT_SERVICE, RESTRICTIONS_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, SERIAL_SERVICE, SIP_SERVICE, STATUS_BAR_SERVICE, STORAGE_SERVICE, TELECOM_SERVICE, TELEPHONY_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, TRUST_SERVICE, TV_INPUT_SERVICE, UI_MODE_SERVICE, UPDATE_LOCK_SERVICE, USAGE_STATS_SERVICE, USB_SERVICE, USER_SERVICE, VIBRATOR_SERVICE, VOICE_INTERACTION_MANAGER_SERVICE, WALLPAPER_SERVICE, WIFI_P2P_SERVICE, WIFI_PASSPOINT_SERVICE, WIFI_RTT_SERVICE, WIFI_SCANNING_SERVICE, WIFI_SERVICE, WINDOW_SERVICE`

    - ### Fields inherited from interface android.content.ComponentCallbacks2

      `TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EditTag()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addTagToLayer(android.view.View v, android.view.MotionEvent event)` Put a tag on the layer.
    `protected void` | `dragNdropTag(android.view.View v, android.view.MotionEvent event, android.widget.ImageView capa1)` Method to drag and drop and destroy icons from the screen.
    `android.support.v4.app.FragmentManager` | `getSupportFragmentManager()`
    `void` | `loadChooserFile()` Opens the system files program installed on the device.
    `protected void` | `onActivityResult(int requestCode, int resultCode, android.content.Intent data)` Gets the file's path.
    `void` | `onBackPressed()` Back button of the device
    `protected void` | `onCreate(android.os.Bundle savedInstanceState)` Perform initialization of all fragments and loaders.
    `boolean` | `onCreateOptionsMenu(android.view.Menu menu)` Initialize the contents of the Activity's standard options menu.
    `void` | `onNavigationDrawerItemSelected(int position)` Called when an item in the navigation drawer is selected.
    `boolean` | `onOptionsItemSelected(android.view.MenuItem item)` This hook is called whenever an item in your options menu is selected.
    `void` | `onSectionAttached(int number)` Options from the left menu.
    `void` | `restoreFile()` Restore the file project by reading the file and creating all necessary objects.
    `void` | `saveQuit()` Ask the user if wants to save the project.
    `void` | `saveToFile(android.widget.EditText fileName)` Save all imporant data into a file so the user can reload it later.
    `protected void` | `setBitmapToPicture()` Calculates the size of the screen and adapts the image into it.
    `android.widget.RelativeLayout` | `setParamsToParentLayer(android.widget.RelativeLayout l)` Sets width and height of the parent layer.
    `void` | `setParamsToTrash(android.widget.ImageView trash)` Sets width and height for trash
    `void` | `updatePositionZoom(android.graphics.PointF point, float x, float y)` We calculate the translation matrix by the equation by changing the 1's of the diagonal by the scale factor.
    `void` | `viewGroupChild(android.widget.ImageView capa1)` Sets width and height of the icon.

    - ### Methods inherited from class android.support.v7.app.ActionBarActivity

      `addContentView, getDrawerToggleDelegate, getMenuInflater, getSupportActionBar, getSupportParentActivityIntent, getV7DrawerToggleDelegate, invalidateOptionsMenu, onConfigurationChanged, onContentChanged, onCreatePanelMenu, onCreatePanelView, onCreateSupportNavigateUpTaskStack, onCreateView, onDestroy, onKeyDown, onKeyShortcut, onMenuItemSelected, onMenuOpened, onPanelClosed, onPostResume, onPrepareOptionsPanel, onPreparePanel, onPrepareSupportNavigateUpTaskStack, onStop, onSupportActionModeFinished, onSupportActionModeStarted, onSupportContentChanged, onSupportNavigateUp, onTitleChanged, setContentView, setContentView, setContentView, setSupportActionBar, setSupportProgress, setSupportProgressBarIndeterminate, setSupportProgressBarIndeterminateVisibility, setSupportProgressBarVisibility, startSupportActionMode, supportInvalidateOptionsMenu, supportNavigateUpTo, supportRequestWindowFeature, supportShouldUpRecreateTask`

    - ### Methods inherited from class android.support.v4.app.FragmentActivity

      `dump, getLastCustomNonConfigurationInstance, getSupportFragmentManager, getSupportLoaderManager, onAttachFragment, onLowMemory, onNewIntent, onPause, onResume, onResumeFragments, onRetainCustomNonConfigurationInstance, onRetainNonConfigurationInstance, onSaveInstanceState, onStart, setEnterSharedElementCallback, setExitSharedElementCallback, startActivityForResult, startActivityFromFragment, supportFinishAfterTransition, supportPostponeEnterTransition, supportStartPostponedEnterTransition`

    - ### Methods inherited from class android.app.Activity

      `closeContextMenu, closeOptionsMenu, convertFromTranslucent, convertToTranslucent, createPendingResult, dismissDialog, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, findViewById, finish, finishActivity, finishActivityFromChild, finishAffinity, finishAfterTransition, finishAndRemoveTask, finishFromChild, getActionBar, getActivityToken, getApplication, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getContentScene, getContentTransitionManager, getCurrentFocus, getFragmentManager, getIntent, getLastNonConfigurationInstance, getLayoutInflater, getLoaderManager, getLocalClassName, getMediaController, getParent, getParentActivityIntent, getPreferences, getRequestedOrientation, getSystemService, getTaskId, getTitle, getTitleColor, getVoiceInteractor, getVolumeControlStream, getWindow, getWindowManager, hasWindowFocus, isBackgroundVisibleBehind, isChangingConfigurations, isChild, isDestroyed, isFinishing, isImmersive, isResumed, isTaskRoot, isVoiceInteraction, managedQuery, managedQuery, moveTaskToBack, navigateUpTo, navigateUpToFromChild, onActionModeFinished, onActionModeStarted, onActivityReenter, onApplyThemeResource, onAttachedToWindow, onAttachFragment, onBackgroundVisibleBehindChanged, onChildTitleChanged, onContextItemSelected, onContextMenuClosed, onCreate, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreateDialog, onCreateNavigateUpTaskStack, onCreateThumbnail, onCreateView, onDetachedFromWindow, onEnterAnimationComplete, onGenericMotionEvent, onKeyLongPress, onKeyMultiple, onKeyUp, onNavigateUp, onNavigateUpFromChild, onNewActivityOptions, onOptionsMenuClosed, onPostCreate, onPostCreate, onPrepareDialog, onPrepareDialog, onPrepareNavigateUpTaskStack, onPrepareOptionsMenu, onProvideAssistData, onRestart, onRestoreInstanceState, onRestoreInstanceState, onSaveInstanceState, onSearchRequested, onTouchEvent, onTrackballEvent, onTrimMemory, onUserInteraction, onUserLeaveHint, onVisibleBehindCanceled, onWindowAttributesChanged, onWindowDismissed, onWindowFocusChanged, onWindowStartingActionMode, openContextMenu, openOptionsMenu, overridePendingTransition, postponeEnterTransition, recreate, registerForContextMenu, releaseInstance, removeDialog, reportFullyDrawn, requestVisibleBehind, requestWindowFeature, runOnUiThread, setActionBar, setContentTransitionManager, setDefaultKeyMode, setEnterSharedElementCallback, setExitSharedElementCallback, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setFinishOnTouchOutside, setImmersive, setIntent, setMediaController, setPersistent, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setTaskDescription, setTitle, setTitle, setTitleColor, setVisible, setVolumeControlStream, shouldUpRecreateTask, showDialog, showDialog, startActionMode, startActivities, startActivities, startActivity, startActivity, startActivityAsCaller, startActivityAsUser, startActivityAsUser, startActivityForResult, startActivityForResultAsUser, startActivityForResultAsUser, startActivityFromChild, startActivityFromChild, startActivityFromFragment, startActivityFromFragment, startActivityIfNeeded, startActivityIfNeeded, startIntentSender, startIntentSender, startIntentSenderForResult, startIntentSenderForResult, startIntentSenderFromChild, startIntentSenderFromChild, startLockTask, startManagingCursor, startNextMatchingActivity, startNextMatchingActivity, startPostponedEnterTransition, startSearch, stopLockTask, stopManagingCursor, takeKeyEvents, triggerSearch, unregisterForContextMenu`

    - ### Methods inherited from class android.view.ContextThemeWrapper

      `applyOverrideConfiguration, attachBaseContext, getResources, getTheme, getThemeResId, setTheme`

    - ### Methods inherited from class android.content.ContextWrapper

      `bindService, bindServiceAsUser, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkUriPermission, checkUriPermission, clearWallpaper, createApplicationContext, createConfigurationContext, createDisplayContext, createPackageContext, createPackageContextAsUser, databaseList, deleteDatabase, deleteFile, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getBaseContext, getBasePackageName, getCacheDir, getClassLoader, getCodeCacheDir, getContentResolver, getDatabasePath, getDir, getDisplayAdjustments, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getExternalMediaDirs, getFilesDir, getFileStreamPath, getMainLooper, getNoBackupFilesDir, getObbDir, getObbDirs, getOpPackageName, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getSharedPreferences, getSharedPrefsFile, getUserId, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isRestricted, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, registerReceiverAsUser, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeUriPermission, sendBroadcast, sendBroadcast, sendBroadcast, sendBroadcastAsUser, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setWallpaper, setWallpaper, startActivitiesAsUser, startInstrumentation, startService, startServiceAsUser, stopService, stopServiceAsUser, unbindService, unregisterReceiver`

    - ### Methods inherited from class android.content.Context

      `getDrawable, getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, registerComponentCallbacks, unregisterComponentCallbacks`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### mToolbarMenu

          protected android.view.Menu mToolbarMenu

    - #### image

          protected android.widget.ImageView image

    - #### layers

          protected java.util.ArrayList<LayerParent> layers

    - #### nameFile

          protected java.lang.String nameFile

    - #### path

          protected java.lang.String path

    - #### uri

          protected android.net.Uri uri

    - #### punt

          protected boolean punt

    - #### area

          protected boolean area

  - ### Constructor Detail

    - #### EditTag

          public EditTag()

  - ### Method Detail

    - #### onCreate

          protected void onCreate(android.os.Bundle savedInstanceState)

      Description copied from class: `android.support.v4.app.FragmentActivity`
      Perform initialization of all fragments and loaders.
      Overrides:
        `onCreate` in class `android.support.v7.app.ActionBarActivity`
      Parameters:
        `savedInstanceState` -
      See Also:
        `Activity.onStart()`, `Activity.onSaveInstanceState(android.os.Bundle)`, `Activity.onRestoreInstanceState(android.os.Bundle)`, `Activity.onPostCreate(android.os.Bundle)`

    - #### updatePositionZoom

          public void updatePositionZoom(android.graphics.PointF point,
                                float x,
                                float y)

      We calculate the translation matrix by the equation by changing the 1's of the diagonal by the scale factor.
      Parameters:
        `point` -
        `x` - old coordinate x
        `y` - old coordinate y

    - #### setBitmapToPicture

          protected void setBitmapToPicture()

      Calculates the size of the screen and adapts the image into it.

    - #### addTagToLayer

          protected void addTagToLayer(android.view.View v,
                           android.view.MotionEvent event)

      Put a tag on the layer.
      Parameters:
        `v` - view of the activity
        `event` -

    - #### dragNdropTag

          protected void dragNdropTag(android.view.View v,
                          android.view.MotionEvent event,
                          android.widget.ImageView capa1)

      Method to drag and drop and destroy icons from the screen. For dots only udate the coordinates by the event, but for areas, we calculate the distance between the end and the start. If the icon is in the trash, it turns red and when the user stops touching the screen, the icon will be destroyed
      Parameters:
        `v` - view of the activity
        `event` -
        `capa1` - layer

    - #### setParamsToParentLayer

          public android.widget.RelativeLayout setParamsToParentLayer(android.widget.RelativeLayout l)

      Sets width and height of the parent layer. Also sets the listener of the parent layer.
      Parameters:
        `l` -
      Returns:

    - #### viewGroupChild

          public void viewGroupChild(android.widget.ImageView capa1)

      Sets width and height of the icon. If it's a dot, don't change size but if it's an area, we make it smaller. Sets a longclicklistener for dragging and destroying the icon or area.
      Parameters:
        `capa1` -

    - #### setParamsToTrash

          public void setParamsToTrash(android.widget.ImageView trash)

      Sets width and height for trash
      Parameters:
        `trash` -

    - #### onNavigationDrawerItemSelected

          public void onNavigationDrawerItemSelected(int position)

      Description copied from interface: `NavigationDrawerFragmentEdit.NavigationDrawerCallbacks`
      Called when an item in the navigation drawer is selected.
      Specified by:
        `onNavigationDrawerItemSelected` in interface `NavigationDrawerFragmentEdit.NavigationDrawerCallbacks`
      Parameters:
        `position` - option that has been selected from the menu.

    - #### onSectionAttached

          public void onSectionAttached(int number)

      Options from the left menu.
      Parameters:
        `number` -

    - #### saveQuit

          public void saveQuit()

      Ask the user if wants to save the project. If the user press yes save dialog will appear and the project will be saved.

    - #### onBackPressed

          public void onBackPressed()

      Back button of the device
      Overrides:
        `onBackPressed` in class `android.support.v7.app.ActionBarActivity`

    - #### onActivityResult

          protected void onActivityResult(int requestCode,
                              int resultCode,
                              android.content.Intent data)

      Gets the file's path. If press back or can't open the file, returns to first activity.
      Overrides:
        `onActivityResult` in class `android.support.v4.app.FragmentActivity`
      Parameters:
        `requestCode` -
        `resultCode` -
        `data` -
      See Also:
        `Activity.startActivityForResult(android.content.Intent, int)`, `Activity.createPendingResult(int, android.content.Intent, int)`, `Activity.setResult(int)`

    - #### loadChooserFile

          public void loadChooserFile()

      Opens the system files program installed on the device.

    - #### saveToFile

          public void saveToFile(android.widget.EditText fileName)

      Save all imporant data into a file so the user can reload it later.
      Parameters:
        `fileName` - name of the project file.

    - #### restoreFile

          public void restoreFile()

      Restore the file project by reading the file and creating all necessary objects.

    - #### onCreateOptionsMenu

          public boolean onCreateOptionsMenu(android.view.Menu menu)

      Description copied from class: `android.app.Activity`
      Initialize the contents of the Activity's standard options menu. You should place your menu items in to menu.

      This is only called once, the first time the options menu is displayed. To update the menu every time it is displayed, see `Activity.onPrepareOptionsMenu(android.view.Menu)`.

      The default implementation populates the menu with standard system menu items. These are placed in the `Menu.CATEGORY_SYSTEM` group so that they will be correctly ordered with application-defined menu items. Deriving classes should always call through to the base implementation.

      You can safely hold on to menu (and any items created from it), making modifications to it as desired, until the next time onCreateOptionsMenu() is called.

      When you add items to the menu, you can implement the Activity's `Activity.onOptionsItemSelected(android.view.MenuItem)` method to handle them there.

      Overrides:
        `onCreateOptionsMenu` in class `android.app.Activity`
      Parameters:
        `menu` - The options menu in which you place your items.
      Returns:
        You must return true for the menu to be displayed; if you return false it will not be shown.
      See Also:
        `Activity.onPrepareOptionsMenu(android.view.Menu)`, `Activity.onOptionsItemSelected(android.view.MenuItem)`

    - #### onOptionsItemSelected

          public boolean onOptionsItemSelected(android.view.MenuItem item)

      Description copied from class: `android.app.Activity`
      This hook is called whenever an item in your options menu is selected. The default implementation simply returns false to have the normal processing happen (calling the item's Runnable or sending a message to its Handler as appropriate). You can use this method for any items for which you would like to do processing without those other facilities.

      Derived classes should call through to the base class for it to perform the default menu handling.

      Overrides:
        `onOptionsItemSelected` in class `android.app.Activity`
      Parameters:
        `item` - The menu item that was selected.
      Returns:
        boolean Return false to allow normal menu processing to proceed, true to consume it here.
      See Also:
        `Activity.onCreateOptionsMenu(android.view.Menu)`

    - #### getSupportFragmentManager

          public android.support.v4.app.FragmentManager getSupportFragmentManager()