Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
Expand All @@ -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()
}




}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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<String>(5)

Expand All @@ -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
Expand Down Expand Up @@ -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()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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")
}


}