Add source code and fork notice in settings.
This commit is contained in:
parent
a566e80ebf
commit
71d1bcc675
2 changed files with 38 additions and 2 deletions
|
@ -208,7 +208,32 @@ class SettingsFragment : PreferenceFragmentCompat(), YesNoDialog.YesNoDialogList
|
|||
preferenceCategoryAbout.title = getString(R.string.pref_about_title)
|
||||
screen.addPreference(preferenceCategoryAbout)
|
||||
|
||||
// set up "App Version" preference
|
||||
val source_code = Preference(context)
|
||||
source_code.title = "Source code"
|
||||
source_code.setIcon(R.drawable.ic_bug_report_24dp)
|
||||
source_code.summary = "Available on github, gitlab, and codeberg."
|
||||
source_code.setOnPreferenceClickListener {
|
||||
val intent = Intent(Intent.ACTION_VIEW)
|
||||
intent.setData(Uri.parse("https://github.com/voussoir/trkpt"))
|
||||
startActivity(intent)
|
||||
return@setOnPreferenceClickListener true
|
||||
}
|
||||
preferenceCategoryAbout.contains(source_code)
|
||||
screen.addPreference(source_code)
|
||||
|
||||
val fork_notice = Preference(context)
|
||||
fork_notice.title = "trkpt is a fork of Trackbook"
|
||||
fork_notice.setIcon(R.drawable.ic_notebook_24dp)
|
||||
fork_notice.summary = "Thank you y20k"
|
||||
fork_notice.setOnPreferenceClickListener {
|
||||
val intent = Intent(Intent.ACTION_VIEW)
|
||||
intent.setData(Uri.parse("https://codeberg.org/y20k/trackbook"))
|
||||
startActivity(intent)
|
||||
return@setOnPreferenceClickListener true
|
||||
}
|
||||
preferenceCategoryAbout.contains(fork_notice)
|
||||
screen.addPreference(fork_notice)
|
||||
|
||||
val preferenceAppVersion = Preference(context)
|
||||
preferenceAppVersion.title = getString(R.string.pref_app_version_title)
|
||||
preferenceAppVersion.setIcon(R.drawable.ic_info_24dp)
|
||||
|
@ -224,7 +249,6 @@ class SettingsFragment : PreferenceFragmentCompat(), YesNoDialog.YesNoDialogList
|
|||
preferenceCategoryAbout.contains(preferenceAppVersion)
|
||||
screen.addPreference(preferenceAppVersion)
|
||||
|
||||
// setup preference screen
|
||||
preferenceScreen = screen
|
||||
}
|
||||
|
||||
|
|
12
app/src/main/res/drawable/ic_notebook_24dp.xml
Normal file
12
app/src/main/res/drawable/ic_notebook_24dp.xml
Normal file
|
@ -0,0 +1,12 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:viewportHeight="96.0"
|
||||
android:viewportWidth="96.0"
|
||||
android:height="24dp"
|
||||
android:width="24dp">
|
||||
<path
|
||||
android:fillColor="@color/icon_default"
|
||||
android:pathData="M44,12.99L20.69,8.74L5.12,5.89C2.29,5.38 0,7.44 0,10.49v67.38c0,3.06 2.29,5.96 5.12,6.47l15.57,2.85l22.19,4.05L44,91.46V12.99z"/>
|
||||
<path
|
||||
android:fillColor="@color/icon_default"
|
||||
android:pathData="M90.88,5.89L75.31,8.74L53.12,12.79L52,12.99v78.46l23.31,-4.26l15.57,-2.85c2.83,-0.52 5.12,-3.41 5.12,-6.47V10.49C96,7.44 93.71,5.38 90.88,5.89z"/>
|
||||
</vector>
|
Loading…
Reference in a new issue