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,6 +5,7 @@ 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
Expand All @@ -17,6 +18,7 @@ class DetailsActivity : AppCompatActivity() {
private var data: ImageData? = null

override fun onCreate(savedInstanceState: Bundle?) {
Log.i("LifeCycle", "${javaClass.simpleName} onCreate")
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_details)

Expand All @@ -30,12 +32,13 @@ class DetailsActivity : AppCompatActivity() {
val intent = Intent(context, FullscreenActivity::class.java)
intent.putExtra("image", data?.fileUriString)
startActivity(intent)
}
} //set on clck listener if pressed on image to display Fullscreen activity -VDT

}

override fun onStart() {
super.onStart()
Log.i("LifeCycle", "${javaClass.simpleName} onStart")

image.setImageURI(data?.fileUri)
// image.setImageDrawable(getResources().getDrawable(android.R.drawable.btn_star));
Expand All @@ -44,9 +47,10 @@ class DetailsActivity : AppCompatActivity() {
text_uri.text = data?.fileUri.toString()
text_description.text = data?.description
edit_description.setText(data?.description)
}
} //sets information and details for selected image

override fun onBackPressed() {
Log.i("LifeCycle", "${javaClass.simpleName} onBackPressed")
data?.name = edit_name.text.toString()
data?.description = edit_description.text.toString()
val resultIntent = Intent()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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
Expand Down Expand Up @@ -55,6 +56,7 @@ class FullscreenActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Log.i("LifeCycle", "${javaClass.simpleName} onCreate")

val stringArray = arrayOfNulls<String>(5)

Expand All @@ -79,7 +81,7 @@ class FullscreenActivity : AppCompatActivity() {

override fun onPostCreate(savedInstanceState: Bundle?) {
super.onPostCreate(savedInstanceState)

Log.i("LifeCycle", "${javaClass.simpleName} onPostCreate")
// Trigger the initial hide() shortly after the activity has been
// created, to briefly hint to the user that UI controls
// are available.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.app.Activity
import android.content.Context
import android.content.Intent
import android.support.v7.widget.RecyclerView
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
Expand Down Expand Up @@ -34,6 +35,7 @@ class ImageListAdapter// Provide a suitable constructor (depends on the kind of
// Create new views (invoked by the layout manager)
override fun onCreateViewHolder(parent: ViewGroup,
viewType: Int): ImageListAdapter.ViewHolder {
Log.i("LifeCycle", "${javaClass.simpleName} onCreateViewHolder")
context = parent.context

// create a new view
Expand All @@ -45,6 +47,7 @@ class ImageListAdapter// Provide a suitable constructor (depends on the kind of

// Replace the contents of a view (invoked by the layout manager)
override fun onBindViewHolder(holder: ImageListAdapter.ViewHolder, position: Int) {
Log.i("LifeCycle", "${javaClass.simpleName} onBindViewHolder")
// - get element from your dataset at this position
// - replace the contents of the view with that element
val data = imageList[position]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Log.i("LifeCycle", "${javaClass.simpleName} onCreate")
//line 31 sets the view to the layout of activity_main.xml - VDT
setContentView(R.layout.activity_main)

val context = this

imageList = ArrayList()

//sets on click listener to request image - VDT
button_add.setOnClickListener {
val intent = Intent(Intent.ACTION_GET_CONTENT)
intent.type = "image/*"
Expand All @@ -57,9 +60,10 @@ class MainActivity : AppCompatActivity() {

private fun refreshListView() {
listAdapter!!.notifyDataSetChanged()
}
} //gets the newly chosen images? -VDT

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
Log.i("LifeCycle", "${javaClass.simpleName} onActivityResult")
if (requestCode == REQUEST_IMAGE_GET && resultCode == RESULT_OK) {
val fullPhotoUri = data!!.data
if (fullPhotoUri != null) {
Expand All @@ -78,7 +82,7 @@ class MainActivity : AppCompatActivity() {

}
refreshListView()

//displays the image chosen along with list of other images -VDT
}

companion object {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.android.tools.build:gradle:3.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"


Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Oct 11 14:14:46 MDT 2018
#Tue Aug 06 16:13:24 EDT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip