Skip to content

Commit

Permalink
Added link browser redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
feelfreelinux committed Dec 11, 2017
1 parent 0ab69a0 commit c66f286
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 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 16
versionName "0.4.1.1"
versionCode 17
versionName "0.4.1.2"

def credentialsPropertiesFile = rootProject.file("credentials.properties")
def credentialsProperties = new Properties()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,28 @@ package io.github.feelfreelinux.wykopmobilny.ui.adapters.viewholders
import android.support.v7.widget.RecyclerView
import android.view.View
import io.github.feelfreelinux.wykopmobilny.models.dataclass.Link
import io.github.feelfreelinux.wykopmobilny.utils.*
import io.github.feelfreelinux.wykopmobilny.utils.api.stripImageCompression
import io.github.feelfreelinux.wykopmobilny.utils.isVisible
import io.github.feelfreelinux.wykopmobilny.utils.loadImage
import io.github.feelfreelinux.wykopmobilny.utils.textview.URLClickedListener
import io.github.feelfreelinux.wykopmobilny.utils.textview.prepareBody
import io.github.feelfreelinux.wykopmobilny.utils.toPrettyDate
import io.github.feelfreelinux.wykopmobilny.utils.textview.removeHtml
import kotlinx.android.synthetic.main.link_layout.view.*
import javax.inject.Inject


class LinkViewHolder(val view: View) : RecyclerView.ViewHolder(view), URLClickedListener {
fun bindView(link : Link) {
view.apply {
title.text = link.title
title.prepareBody(link.title, this@LinkViewHolder)
title.text = link.title.removeHtml()
link.preview?.let { image.loadImage(link.preview.stripImageCompression()) }
description.prepareBody(link.description, this@LinkViewHolder)
description.text = link.description
description.text = link.description.removeHtml()
diggCountTextView.text = link.voteCount.toString()
commentsCountTextView.text = link.commentsCount.toString()
dateTextView.text = link.date.toPrettyDate()
hotBadgeStrip.isVisible = link.isHot
setOnClickListener {
view.getActivityContext()!!.openBrowser(link.sourceUrl)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ class NavigationActivity : BaseActivity(), MainNavigationView, NavigationView.On
JobUtil.hasBootPermission(this)

// Setup AppUpdater
AppUpdater(this)
/*AppUpdater(this)
.setUpdateFrom(UpdateFrom.GITHUB)
.setGitHubUserAndRepo("feelfreelinux", "WykopMobilny")
.setTitleOnUpdateAvailable(R.string.update_available)
.setContentOnUpdateAvailable(R.string.update_app)
.setButtonDismiss(R.string.cancel)
.setButtonDoNotShowAgain(R.string.do_not_show_again)
.setButtonUpdate(R.string.update)
.start()
.start()*/

if (settingsApi.showNotifications) {
// Schedules notification service
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/layout/link_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
android:layout_width="@dimen/link_layout_image_width"
android:layout_height="0dp"
android:scaleType="centerCrop"
android:clickable="false"
android:focusable="false"
android:duplicateParentState="true"
android:src="@drawable/ic_wykopmobilny"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
Expand All @@ -33,6 +36,9 @@
android:textSize="@dimen/link_layout_title_font_size"
android:textStyle="bold"
android:maxLines="2"
android:clickable="false"
android:focusable="false"
android:duplicateParentState="true"
app:layout_constraintStart_toEndOf="@id/image"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
Expand All @@ -47,6 +53,9 @@
android:paddingBottom="@dimen/link_layout_description_padding_bottom"
android:textSize="@dimen/link_layout_description_font_size"
android:maxLines="3"
android:clickable="false"
android:focusable="false"
android:duplicateParentState="true"
app:layout_constraintStart_toEndOf="@id/image"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title"
Expand Down

0 comments on commit c66f286

Please sign in to comment.