Skip to content

Commit

Permalink
all: smoother disclaimer link (fixes #5017) (#5018)
Browse files Browse the repository at this point in the history
Co-authored-by: Gideon Okuro <[email protected]>
Co-authored-by: dogi <[email protected]>
  • Loading branch information
3 people authored Jan 15, 2025
1 parent 94c4a6b commit 29f0f0d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "org.ole.planet.myplanet"
minSdkVersion 26
targetSdkVersion 34
versionCode 2200
versionName "0.22.0"
versionCode 2201
versionName "0.22.1"
ndkVersion '21.3.6528147'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
package org.ole.planet.myplanet.ui.dashboard

import android.os.Bundle
import android.text.Html
import android.text.method.LinkMovementMethod
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.text.HtmlCompat
import androidx.fragment.app.Fragment
import org.ole.planet.myplanet.R
import org.ole.planet.myplanet.databinding.FragmentDisclaimerBinding
import org.ole.planet.myplanet.utilities.Constants

class DisclaimerFragment : Fragment() {
private lateinit var fragmentDisclaimerBinding: FragmentDisclaimerBinding

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
fragmentDisclaimerBinding = FragmentDisclaimerBinding.inflate(inflater, container, false)
fragmentDisclaimerBinding.tvDisclaimer.text = Html.fromHtml(getString(Constants.DISCLAIMER), HtmlCompat.FROM_HTML_MODE_LEGACY)
return fragmentDisclaimerBinding.root
}
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
fragmentDisclaimerBinding.tvDisclaimer.text = HtmlCompat.fromHtml(getString(R.string.disclaimer), HtmlCompat.FROM_HTML_MODE_LEGACY)
fragmentDisclaimerBinding.tvDisclaimer.movementMethod = LinkMovementMethod.getInstance()
}
}
4 changes: 3 additions & 1 deletion app/src/main/res/layout/fragment_disclaimer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@
android:id="@+id/tv_disclaimer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="@color/daynight_textColor" />
android:textColor="@color/daynight_textColor"
android:autoLink="web"
android:linksClickable="true"/>
</androidx.core.widget.NestedScrollView>

0 comments on commit 29f0f0d

Please sign in to comment.