diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/lambdaschool/favoritepicturesgallery/DetailsActivity.kt b/app/src/main/java/com/lambdaschool/favoritepicturesgallery/DetailsActivity.kt
index 713027d..609ae07 100644
--- a/app/src/main/java/com/lambdaschool/favoritepicturesgallery/DetailsActivity.kt
+++ b/app/src/main/java/com/lambdaschool/favoritepicturesgallery/DetailsActivity.kt
@@ -5,11 +5,13 @@ import android.content.Context
import android.content.Intent
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
+import android.util.Log
import android.view.View
import android.view.WindowManager
import android.widget.EditText
import android.widget.ImageView
import android.widget.TextView
+import android.widget.Toast
import kotlinx.android.synthetic.main.activity_details.*
class DetailsActivity : AppCompatActivity() {
@@ -19,24 +21,32 @@ class DetailsActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_details)
+ Toast.makeText(this, "Lifecycle - onCreate", Toast.LENGTH_SHORT).show()
+ Log.i(javaClass.simpleName, "Lifecycle-onCreate")
val intent = intent
data = intent.getSerializableExtra("object") as ImageData
val context = this
this.window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN)
-
+//AH pressing the image will open a full screen window and start the full screen activity
image.setOnClickListener {
val intent = Intent(context, FullscreenActivity::class.java)
intent.putExtra("image", data?.fileUriString)
startActivity(intent)
}
+
+
+
}
override fun onStart() {
super.onStart()
+ Toast.makeText(this, "Lifecycle - onStart", Toast.LENGTH_SHORT).show()
+ Log.i(javaClass.simpleName, "Lifecycle-onStart")
+ //AH- Setting and Showing up all the Image data to the screen
image.setImageURI(data?.fileUri)
// image.setImageDrawable(getResources().getDrawable(android.R.drawable.btn_star));
text_name.text = data?.name
@@ -54,4 +64,37 @@ class DetailsActivity : AppCompatActivity() {
setResult(Activity.RESULT_OK, resultIntent)
finish()
}
+
+ override fun onResume() {
+ super.onResume()
+ Toast.makeText(this, "Lifecycle - onResume", Toast.LENGTH_SHORT).show()
+ Log.i(javaClass.simpleName, "Lifecycle-onResume")
+
+ }
+ override fun onPause() {
+ super.onPause()
+ Toast.makeText(this, "Lifecycle - onPause", Toast.LENGTH_SHORT).show()
+ Log.i(javaClass.simpleName, "Lifecycle-onPause")
+
+ }
+ override fun onStop() {
+ super.onStop()
+ Toast.makeText(this, "Lifecycle - onStop", Toast.LENGTH_SHORT).show()
+ Log.i(javaClass.simpleName, "Lifecycle-onStop")
+
+ }
+ override fun onDestroy() {
+ Toast.makeText(this, "Lifecycle - onDestroy", Toast.LENGTH_SHORT).show()
+ Log.i(javaClass.simpleName, "Lifecycle-onDestroy")
+ super.onDestroy()
+ }
+ override fun onRestart() {
+ Toast.makeText(this, "Lifecycle - onRestart", Toast.LENGTH_SHORT).show()
+ Log.i(javaClass.simpleName, "Lifecycle-onRestart")
+ super.onRestart()
+ }
+
+
+
+
}
diff --git a/app/src/main/java/com/lambdaschool/favoritepicturesgallery/FullscreenActivity.kt b/app/src/main/java/com/lambdaschool/favoritepicturesgallery/FullscreenActivity.kt
index 3720f26..ef0ebf7 100644
--- a/app/src/main/java/com/lambdaschool/favoritepicturesgallery/FullscreenActivity.kt
+++ b/app/src/main/java/com/lambdaschool/favoritepicturesgallery/FullscreenActivity.kt
@@ -8,9 +8,11 @@ import android.net.Uri
import android.os.Bundle
import android.os.Handler
import android.support.v7.app.AppCompatActivity
+import android.util.Log
import android.view.MotionEvent
import android.view.View
import android.widget.ImageView
+import android.widget.Toast
/**
* An example full-screen activity that shows and hides the system UI (i.e.
@@ -55,6 +57,8 @@ class FullscreenActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
+ Toast.makeText(this, "Lifecycle - onCreate", Toast.LENGTH_SHORT).show()
+ Log.i(javaClass.simpleName, "Lifecycle-onCreate")
val stringArray = arrayOfNulls(5)
@@ -79,6 +83,8 @@ class FullscreenActivity : AppCompatActivity() {
override fun onPostCreate(savedInstanceState: Bundle?) {
super.onPostCreate(savedInstanceState)
+ Toast.makeText(this, "Lifecycle - onPostCreate", Toast.LENGTH_SHORT).show()
+ Log.i(javaClass.simpleName, "onPostCreate")
// Trigger the initial hide() shortly after the activity has been
// created, to briefly hint to the user that UI controls
@@ -145,4 +151,40 @@ class FullscreenActivity : AppCompatActivity() {
*/
private val UI_ANIMATION_DELAY = 300
}
+
+ override fun onStart() {
+ super.onStart()
+ Toast.makeText(this, "Lifecycle - onStart", Toast.LENGTH_SHORT).show()
+ Log.i(javaClass.simpleName, "Lifecycle-onStart")
+ }
+
+ override fun onResume() {
+ super.onResume()
+ Toast.makeText(this, "Lifecycle - onResume", Toast.LENGTH_SHORT).show()
+ Log.i(javaClass.simpleName, "Lifecycle-onResume")
+
+ }
+ override fun onPause() {
+ super.onPause()
+ Toast.makeText(this, "Lifecycle - onPause", Toast.LENGTH_SHORT).show()
+ Log.i(javaClass.simpleName, "Lifecycle-onPause")
+
+ }
+ override fun onStop() {
+ super.onStop()
+ Toast.makeText(this, "Lifecycle - onStop", Toast.LENGTH_SHORT).show()
+ Log.i(javaClass.simpleName, "Lifecycle-onStop")
+
+ }
+ override fun onDestroy() {
+ Toast.makeText(this, "Lifecycle - onDestroy", Toast.LENGTH_SHORT).show()
+ Log.i(javaClass.simpleName, "Lifecycle-onDestroy")
+ super.onDestroy()
+ }
+ override fun onRestart() {
+ Toast.makeText(this, "Lifecycle - onRestart", Toast.LENGTH_SHORT).show()
+ Log.i(javaClass.simpleName, "Lifecycle-onRestart")
+ super.onRestart()
+ }
+
}
diff --git a/app/src/main/java/com/lambdaschool/favoritepicturesgallery/ImageData.kt b/app/src/main/java/com/lambdaschool/favoritepicturesgallery/ImageData.kt
index 8dd46c0..b2720cd 100644
--- a/app/src/main/java/com/lambdaschool/favoritepicturesgallery/ImageData.kt
+++ b/app/src/main/java/com/lambdaschool/favoritepicturesgallery/ImageData.kt
@@ -3,7 +3,7 @@ package com.lambdaschool.favoritepicturesgallery
import android.net.Uri
import java.io.Serializable
-
+//AH - Getting all the Image data in this class
class ImageData(fullPhotoUri: Uri) : Serializable {
var name: String? = null
var description: String? = null
diff --git a/app/src/main/java/com/lambdaschool/favoritepicturesgallery/MainActivity.kt b/app/src/main/java/com/lambdaschool/favoritepicturesgallery/MainActivity.kt
index 0539b53..d39ebea 100644
--- a/app/src/main/java/com/lambdaschool/favoritepicturesgallery/MainActivity.kt
+++ b/app/src/main/java/com/lambdaschool/favoritepicturesgallery/MainActivity.kt
@@ -14,6 +14,7 @@ import android.view.View
import android.widget.Button
import android.widget.LinearLayout
import android.widget.TextView
+import android.widget.Toast
import kotlinx.android.synthetic.main.activity_main.*
import java.util.ArrayList
@@ -26,6 +27,8 @@ class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
+ Toast.makeText(this, "Lifecycle - onCreate", Toast.LENGTH_SHORT).show()
+ Log.i(javaClass.simpleName, "Lifecycle-onCreate")
setContentView(R.layout.activity_main)
val context = this
@@ -86,4 +89,39 @@ class MainActivity : AppCompatActivity() {
internal const val REQUEST_IMAGE_GET = 1
internal const val EDIT_IMAGE_REQUEST = 2
}
+ override fun onRestart() {
+ Toast.makeText(this, "Lifecycle - onRestart", Toast.LENGTH_SHORT).show()
+ Log.i(javaClass.simpleName, "Lifecycle-onRestart")
+ super.onRestart()
+ }
+ override fun onDestroy() {
+ Toast.makeText(this, "Lifecycle - onDestroy", Toast.LENGTH_SHORT).show()
+ Log.i(javaClass.simpleName, "Lifecycle-onDestroy")
+ super.onDestroy()
+ }
+ override fun onStop() {
+ super.onStop()
+ Toast.makeText(this, "Lifecycle - onStop", Toast.LENGTH_SHORT).show()
+ Log.i(javaClass.simpleName, "Lifecycle-onStop")
+
+ }
+ override fun onPause() {
+ super.onPause()
+ Toast.makeText(this, "Lifecycle - onPause", Toast.LENGTH_SHORT).show()
+ Log.i(javaClass.simpleName, "Lifecycle-onPause")
+
+ }
+ override fun onResume() {
+ super.onResume()
+ Toast.makeText(this, "Lifecycle - onResume", Toast.LENGTH_SHORT).show()
+ Log.i(javaClass.simpleName, "Lifecycle-onResume")
+
+ }
+ override fun onStart() {
+ super.onStart()
+ Toast.makeText(this, "Lifecycle - onStart", Toast.LENGTH_SHORT).show()
+ Log.i(javaClass.simpleName, "Lifecycle-onStart")
+ }
+
+
}