diff --git a/build.gradle b/build.gradle index 5a98879b..323f8564 100644 --- a/build.gradle +++ b/build.gradle @@ -23,12 +23,10 @@ android { defaultConfig { archivesBaseName = 'droidify' applicationId 'com.looker.droidify' - minSdk 28 + minSdk 21 targetSdk 31 versionCode 3 versionName '0.3' - - vectorDrawables.useSupportLibrary true } sourceSets.all { @@ -36,6 +34,15 @@ android { it.java.srcDirs += new File(javaDir.parentFile, 'kotlin') } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = compileOptions.sourceCompatibility.toString() + } + buildTypes { debug { minifyEnabled false @@ -103,8 +110,10 @@ repositories { } dependencies { + implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:' + versions.kotlin implementation 'androidx.core:core-ktx:1.6.0' implementation 'androidx.fragment:fragment-ktx:1.3.6' + implementation 'androidx.vectordrawable:vectordrawable:1.1.0' implementation 'androidx.viewpager2:viewpager2:1.0.0' implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.2' implementation 'io.reactivex.rxjava3:rxjava:3.1.1' diff --git a/src/main/kotlin/com/looker/droidify/screen/SettingsFragment.kt b/src/main/kotlin/com/looker/droidify/screen/SettingsFragment.kt index e26be6cd..7cd2a533 100644 --- a/src/main/kotlin/com/looker/droidify/screen/SettingsFragment.kt +++ b/src/main/kotlin/com/looker/droidify/screen/SettingsFragment.kt @@ -4,7 +4,6 @@ import android.app.AlertDialog import android.app.Dialog import android.content.Context import android.content.Intent -import android.net.Uri import android.os.Bundle import android.text.InputFilter import android.text.InputType @@ -13,6 +12,7 @@ import android.view.View import android.view.ViewGroup import android.view.WindowManager import android.widget.* +import androidx.core.net.toUri import androidx.fragment.app.DialogFragment import androidx.fragment.app.Fragment import com.looker.droidify.BuildConfig @@ -109,16 +109,14 @@ class SettingsFragment : ScreenFragment() { getString(R.string.incompatible_versions_summary) ) } - // Adding Credits to Foxy - //TODO "Fix Linking" preferences.addCategory("Credits") { addText( title = "Based on an App by kitsunyan", summary = "FoxyDroid" - ).also { + ).apply { setOnClickListener { - openURI(urlToSite = "https://github.com/kitsunyan/foxy-droid/") + openURI() } } addText( @@ -127,14 +125,10 @@ class SettingsFragment : ScreenFragment() { ) } - // End Credits - disposable = Preferences.observable.subscribe(this::updatePreference) updatePreference(null) } - // Add Text for Credits - private fun LinearLayout.addText(title: String, summary: String) { val text = TextView(context) val subText = TextView(context) @@ -156,11 +150,11 @@ class SettingsFragment : ScreenFragment() { ) } - private fun openURI(urlToSite: String) { - val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(urlToSite)) + private fun openURI() { + val browserIntent = + Intent(Intent.ACTION_VIEW, "https://github.com/kitsunyan/foxy-droid/".toUri()) startActivity(browserIntent) } - // End Add Text for Credits override fun onDestroyView() { super.onDestroyView()