Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

b #6

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

b #6

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
1 change: 1 addition & 0 deletions .idea/.name

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

6 changes: 6 additions & 0 deletions .idea/compiler.xml

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

3 changes: 2 additions & 1 deletion .idea/gradle.xml

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

2 changes: 1 addition & 1 deletion .idea/misc.xml

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

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

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

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
An android app which lets you share memes among your friends.

Youtube playlist for this Project: https://bit.ly/3hGQOfS
<follow Anuj bhaiya on youtube channel>
</br>
</br>
[![Watch the video](https://img.youtube.com/vi/W3lgZuaIuqU/hqdefault.jpg)](https://youtu.be/W3lgZuaIuqU)
15 changes: 6 additions & 9 deletions app/src/main/java/com/example/sharememes/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ class MainActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

loadMeme()
loadMemes()
}

private fun loadMeme() {
private fun loadMemes() {
nextButton.isEnabled = false
shareButton.isEnabled = false
progressBar.visibility = View.VISIBLE
Expand All @@ -37,7 +37,7 @@ class MainActivity : AppCompatActivity() {
// Request a string response from the provided URL.
val jsonObjectRequest = JsonObjectRequest(
Request.Method.GET, url, null,
Response.Listener { response ->
{ response ->
currentMemeUrl = response.getString("url")

Glide.with(this).load(currentMemeUrl).listener(object : RequestListener<Drawable>{
Expand Down Expand Up @@ -65,7 +65,7 @@ class MainActivity : AppCompatActivity() {
}
}).into(memeImageView)
},
Response.ErrorListener {
{
progressBar.visibility = View.GONE
Toast.makeText(this, "Something went wrong", Toast.LENGTH_LONG).show()
})
Expand All @@ -75,13 +75,10 @@ class MainActivity : AppCompatActivity() {
}

fun showNextMeme(view: View) {
loadMeme()
loadMemes()
}

fun shareMeme(view: View) {
val i = Intent(Intent.ACTION_SEND)
i.type = "text/plain"
i.putExtra(Intent.EXTRA_TEXT, "Hi, checkout this meme $currentMemeUrl")
startActivity(Intent.createChooser(i, "Share this meme with"))

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

// NOTE: Do not place your application dependencies here; they belong
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip