Skip to content

Commit

Permalink
Add homepage and Ko-fi link
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlecat committed Dec 22, 2024
1 parent e925952 commit ecc472a
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 26 deletions.
54 changes: 29 additions & 25 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,70 @@
# Changelog

## Version 30

* Added a link to the project page.

## Version 29

* Updated app icon
* Updated translations
* Updated app icon.
* Updated translations.

## Version 28

* Fixed issue with inconsistent clickable area for counter value.

## Version 27

* Menu styling adjustment
* Menu styling adjustment.

## Version 26

* Styling adjustment
* Styling adjustment.

## Version 25

* Visual refresh
* Visual refresh.

## Version 24

* Counters in the list are now stored alphabetically
* Counters in the list are now stored alphabetically.

## Version 23

* Translation updates
* Fixes for some types of app crashes
* Translation updates.
* Fixes for some types of app crashes.

## Version 22

* Added a way to export all counters in CSV format (this feature can be accessed from app settings)
* Added a way to export all counters in CSV format (this feature can be accessed from app settings).

## Version 21

* Translation updates
* Major refactoring under the hood
* Translation updates.
* Major refactoring under the hood.

## Version 20

* Maximum (and minimum) counter limits are now significantly higher
* Maximum (and minimum) counter limits are now significantly higher.

## Version 19

* Added a way to increment the counter by clicking on the value
* List of counters is now sorted alphabetically
* Translation updates
* Added a way to increment the counter by clicking on the value.
* List of counters is now sorted alphabetically.
* Translation updates.

## Version 18

* Increased minimum Android version requirement to 4.0 (Ice Cream Sandwich)
* Fixed counter visibility in the dark theme
* Added icons into settings
* Translation updates
* Increased minimum Android version requirement to 4.0 (Ice Cream Sandwich).
* Fixed counter visibility in the dark theme.
* Added icons into settings.
* Translation updates.

## Version 17

* Dark theme
* RTL support
* Translation updates
* Dark theme.
* RTL support.
* Translation updates.

## Version 16
* Minor user interface updates (using new Android APIs).
Expand All @@ -77,7 +81,7 @@
* Added Arabic and Finnish translations, updated old ones.

## Version 13
* Fixed broken back button
* Fixed broken back button.

## Version 12
* Removed delay from hardware buttons.
Expand All @@ -95,12 +99,12 @@
* Updated localization (added Czech and updated other languages).

## Version 9
* Added "About" window
* Added "About" window.
* Interface improvements for devices with small screens.
* Updated localization (added German, Spanish, and French).

## Version 8
* Updated app icon
* Updated app icon.

## 2.3.1 (7)
* Added Italian localization (made by Vincenzo Petronio).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager.NameNotFoundException;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.MenuItem;
Expand All @@ -28,6 +29,7 @@ public class SettingsActivity extends AppCompatActivity

public static final String KEY_REMOVE_COUNTERS = "removeCounters";
public static final String KEY_EXPORT_COUNTERS = "exportCounters";
public static final String KEY_HOMEPAGE = "homepage";
public static final String KEY_VERSION = "version";

private SharedPreferences sharedPrefs;
Expand All @@ -47,6 +49,7 @@ private void initSettingsFragment() {
settingsFragment = new SettingsFragment();
settingsFragment.setOnRemoveCountersClickListener(getOnRemoveCountersClickListener());
settingsFragment.setOnExportClickListener(getOnExportClickListener());
settingsFragment.setOnHomepageClickListener(getOnHomepageClickListener());
settingsFragment.setAppVersion(getAppVersion());
settingsFragment.setTheme(getCurrentThemeName());

Expand Down Expand Up @@ -86,6 +89,13 @@ private OnPreferenceClickListener getOnExportClickListener() {
};
}

private OnPreferenceClickListener getOnHomepageClickListener() {
return preference -> {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://counter.roman.zone")));
return true;
};
}

@Override
protected void onPostCreate(final Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package me.tsukanov.counter.view;

import static me.tsukanov.counter.activities.SettingsActivity.KEY_EXPORT_COUNTERS;
import static me.tsukanov.counter.activities.SettingsActivity.KEY_HOMEPAGE;
import static me.tsukanov.counter.activities.SettingsActivity.KEY_REMOVE_COUNTERS;
import static me.tsukanov.counter.activities.SettingsActivity.KEY_VERSION;

Expand All @@ -18,6 +19,7 @@ public final class SettingsFragment extends PreferenceFragmentCompat {

private OnPreferenceClickListener onRemoveCountersClickListener;
private OnPreferenceClickListener onExportClickListener;
private OnPreferenceClickListener onHomepageClickListener;
private String appVersion;
private String theme;

Expand All @@ -31,6 +33,11 @@ public void setOnExportClickListener(
this.onExportClickListener = onExportClickListener;
}

public void setOnHomepageClickListener(
final @NonNull OnPreferenceClickListener onHomepageClickListener) {
this.onHomepageClickListener = onHomepageClickListener;
}

public void setAppVersion(String appVersion) {
this.appVersion = appVersion;
}
Expand All @@ -53,6 +60,8 @@ public void onCreate(final Bundle savedInstanceState) {
.setOnPreferenceClickListener(onRemoveCountersClickListener);
findPreference(KEY_EXPORT_COUNTERS).setOnPreferenceClickListener(onExportClickListener);

findPreference(KEY_HOMEPAGE).setOnPreferenceClickListener(onHomepageClickListener);

} catch (NullPointerException e) {
Log.e(TAG, "Unable to retrieve one of the preferences", e);
}
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_link.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#878787"
android:pathData="M3.9,12c0,-1.71 1.39,-3.1 3.1,-3.1h4L11,7L7,7c-2.76,0 -5,2.24 -5,5s2.24,5 5,5h4v-1.9L7,15.1c-1.71,0 -3.1,-1.39 -3.1,-3.1zM8,13h8v-2L8,11v2zM17,7h-4v1.9h4c1.71,0 3.1,1.39 3.1,3.1s-1.39,3.1 -3.1,3.1h-4L13,17h4c2.76,0 5,-2.24 5,-5s-2.24,-5 -5,-5z" />
</vector>
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
<string name="settings_wipe_title">Remove all counters</string>
<string name="settings_export_title">Export counters</string>
<string name="settings_export_summary">Export all counters in CSV format</string>
<string name="settings_homepage_title">Homepage</string>
<string name="settings_homepage_summary">App info and the source code</string>
<string name="settings_wipe_confirmation">Do you really want to remove all counters?</string>
<string name="settings_wipe_confirmation_yes">Remove all</string>

Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/xml/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@
android:key="exportCounters"
android:summary="@string/settings_export_summary"
android:title="@string/settings_export_title" />
<Preference
android:icon="@drawable/ic_link"
android:key="homepage"
android:summary="@string/settings_homepage_summary"
android:title="@string/settings_homepage_title" />
<Preference
android:enabled="false"
android:icon="@drawable/ic_info"
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ext {
compileSdkVersion = 35
minSdkVersion = 21

appVersion = 29
appVersion = 30
}

task clean(type: Delete) {
Expand Down

0 comments on commit ecc472a

Please sign in to comment.