Skip to content

Commit

Permalink
Beta 0.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
feelfreelinux committed Nov 19, 2017
1 parent 637dfb4 commit 6674c16
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 25 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ android {
applicationId "io.github.feelfreelinux.wykopmobilny"
minSdkVersion 17
targetSdkVersion 26
versionCode 7
versionName "0.2.2"
versionCode 8
versionName "0.2.3"

def credentialsPropertiesFile = rootProject.file("credentials.properties")
def credentialsProperties = new Properties()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ class InputToolbar : ConstraintLayout, MarkdownToolbarListener {
}

fun addAddressant(user : String) {
defaultText = ""
body.requestFocus()
textBody += "@$user: "
selectionPosition = textBody.length
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,17 @@ package io.github.feelfreelinux.wykopmobilny.ui.widgets
import android.app.Activity
import android.content.Context
import android.util.AttributeSet
import android.widget.FrameLayout
import android.widget.ImageView
import io.github.feelfreelinux.wykopmobilny.WykopApp
import io.github.feelfreelinux.wykopmobilny.glide.GlideApp
import io.github.feelfreelinux.wykopmobilny.models.dataclass.Embed
import io.github.feelfreelinux.wykopmobilny.ui.modules.NavigatorApi
import io.github.feelfreelinux.wykopmobilny.utils.*
import kotlinx.android.synthetic.main.wykopimageview_layout.view.*
import io.github.feelfreelinux.wykopmobilny.utils.SettingsPreferencesApi
import io.github.feelfreelinux.wykopmobilny.utils.isVisible
import io.github.feelfreelinux.wykopmobilny.utils.loadImage
import io.github.feelfreelinux.wykopmobilny.utils.openBrowser
import javax.inject.Inject

class WykopImageView : FrameLayout {
constructor(context: Context) : super(context)

constructor(context: Context, attrs: AttributeSet) : super(context, attrs)

constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr)

class WykopImageView(context: Context, attrs: AttributeSet) : ImageView(context, attrs) {
companion object {
val NSFW_IMAGE_PLACEHOLDER = "https://www.wykop.pl/cdn/c2526412/nsfw.jpg"
}
Expand All @@ -36,8 +30,8 @@ class WykopImageView : FrameLayout {
if (embed == null) isVisible = false
embed?.apply {
isVisible = true
if (plus18 && !settingsPreferences.showAdultContent) loadImageFromUrl(NSFW_IMAGE_PLACEHOLDER)
else loadImageFromUrl(preview)
if (plus18 && !settingsPreferences.showAdultContent) loadImage(NSFW_IMAGE_PLACEHOLDER)
else loadImage(preview)
setOnClickListener {
when (type) {
"image" -> navigatorApi.openPhotoViewActivity(context as Activity, url)
Expand All @@ -46,14 +40,4 @@ class WykopImageView : FrameLayout {
}
}
}

fun loadImageFromUrl(url : String) {
GlideApp
.with(context)
.load(url)
.listener(KotlinGlideRequestListener(
{ progressView.isVisible = false },
{ progressView.isVisible = false }))
.into(image)
}
}

0 comments on commit 6674c16

Please sign in to comment.