diff --git a/launcher/src/main/java/com/italankin/lnch/feature/settings/SettingsRootFragment.java b/launcher/src/main/java/com/italankin/lnch/feature/settings/SettingsRootFragment.java index f8107ea3..07a4c3a5 100644 --- a/launcher/src/main/java/com/italankin/lnch/feature/settings/SettingsRootFragment.java +++ b/launcher/src/main/java/com/italankin/lnch/feature/settings/SettingsRootFragment.java @@ -13,6 +13,10 @@ import android.view.View; import android.widget.Toast; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.preference.Preference; + import com.italankin.lnch.BuildConfig; import com.italankin.lnch.R; import com.italankin.lnch.feature.home.fragmentresult.SignalFragmentResultContract; @@ -20,10 +24,6 @@ import com.italankin.lnch.util.IntentUtils; import com.italankin.lnch.util.PackageUtils; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.preference.Preference; - public class SettingsRootFragment extends BasePreferenceFragment { public static SettingsRootFragment newInstance(String requestKey) { @@ -35,6 +35,7 @@ public static SettingsRootFragment newInstance(String requestKey) { } private static final String SOURCE_CODE_URL = "https://github.com/italankin/lnch"; + private static final String RELEASE_NOTES_FORMAT = "https://github.com/italankin/lnch/releases/tag/%s"; @Override public void onCreate(Bundle savedInstanceState) { @@ -97,6 +98,13 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat }); Preference version = findPreference(R.string.pref_key_version); version.setTitle(getString(R.string.settings_version, BuildConfig.VERSION_NAME)); + version.setOnPreferenceClickListener(preference -> { + String releaseNotesUrl = String.format(RELEASE_NOTES_FORMAT, BuildConfig.VERSION_NAME); + Uri uri = Uri.parse(releaseNotesUrl); + Intent intent = new Intent(Intent.ACTION_VIEW, uri); + startActivity(Intent.createChooser(intent, "")); + return true; + }); Preference sourceCode = findPreference(R.string.pref_key_source_code); sourceCode.setOnPreferenceClickListener(preference -> { Uri uri = Uri.parse(SOURCE_CODE_URL);