This commit is contained in:
Sylvia van Os
2021-10-03 22:43:51 +02:00
parent fcdde83038
commit f78494f882
6 changed files with 67 additions and 78 deletions

View File

@@ -1,5 +1,10 @@
# Changelog
## Unreleased
- Improved Android 12 support
- Improved about screen
## v2.6.1 - 84 (2021-09-25)
- Minor bugfixes and improvements

View File

@@ -98,16 +98,16 @@ public class AboutActivity extends CatimaAppCompatActivity implements View.OnCli
Log.w(TAG, "Package name not found", e);
}
TextView copyright = findViewById(R.id.copyright);
TextView copyright = findViewById(R.id.credits_sub);
copyright.setText(String.format(getString(R.string.app_copyright_fmt), year));
TextView vHistory = findViewById(R.id.history);
TextView vHistory = findViewById(R.id.version_history_sub);
vHistory.setText(String.format(getString(R.string.debug_version_fmt), version));
setTitle(String.format(getString(R.string.about_title_fmt), appName));
version_history = findViewById(R.id.version_history);
translate = findViewById(R.id.translate);
license = findViewById(R.id.License);
license = findViewById(R.id.license);
repo = findViewById(R.id.repo);
privacy = findViewById(R.id.privacy);
error = findViewById(R.id.report_error);
@@ -123,8 +123,14 @@ public class AboutActivity extends CatimaAppCompatActivity implements View.OnCli
rate.setOnClickListener(this);
StringBuilder contributorInfo = new StringBuilder();
contributorInfo.append(HtmlCompat.fromHtml(String.format(getString(R.string.app_contributors), contributors.toString()),
HtmlCompat.FROM_HTML_MODE_COMPACT));
contributorInfo.append(HtmlCompat.fromHtml(String.format(getString(R.string.app_contributors), contributors.toString()), HtmlCompat.FROM_HTML_MODE_COMPACT));
contributorInfo.append("\n\n");
contributorInfo.append(getString(R.string.app_copyright_old));
contributorInfo.append("\n\n");
contributorInfo.append(HtmlCompat.fromHtml(String.format(getString(R.string.app_libraries), libs.toString()), HtmlCompat.FROM_HTML_MODE_COMPACT));
contributorInfo.append("\n\n");
contributorInfo.append(HtmlCompat.fromHtml(String.format(getString(R.string.app_resources), resources.toString()), HtmlCompat.FROM_HTML_MODE_COMPACT));
credits.setOnClickListener(view -> new AlertDialog.Builder(this)
.setTitle(R.string.credits)
.setMessage(contributorInfo.toString())
@@ -144,36 +150,30 @@ public class AboutActivity extends CatimaAppCompatActivity implements View.OnCli
@Override
public void onClick(View view) {
Intent intent = new Intent(Intent.ACTION_VIEW);
if (R.id.version_history == view.getId()) {
String url = "https://catima.app/changelog/";
intent.setData(Uri.parse(url));
startActivity(intent);
} else if (R.id.translate == view.getId()) {
String translateUrl = "https://hosted.weblate.org/engage/catima/";
intent.setData(Uri.parse(translateUrl));
startActivity(intent);
} else if (R.id.License == view.getId()) {
String licenseUrl = "https://github.com/TheLastProject/Catima/blob/master/LICENSE";
intent.setData(Uri.parse(licenseUrl));
startActivity(intent);
} else if (R.id.repo == view.getId()) {
String repo = "https://github.com/TheLastProject/Catima/";
intent.setData(Uri.parse(repo));
startActivity(intent);
} else if (R.id.privacy == view.getId()) {
String privacy = "https://catima.app/privacy-policy/";
intent.setData(Uri.parse(privacy));
startActivity(intent);
} else if (R.id.report_error == view.getId()) {
String errorUrl = "https://github.com/TheLastProject/Catima/issues";
intent.setData(Uri.parse(errorUrl));
startActivity(intent);
} else if (R.id.rate == view.getId()) {
String rateUrl = "https://play.google.com/store/apps/details?id=me.hackerchick.catima";
intent.setData(Uri.parse(rateUrl));
startActivity(intent);
int id = view.getId();
String url;
if (id == R.id.version_history) {
url = "https://catima.app/changelog/";
} else if (id == R.id.translate) {
url = "https://hosted.weblate.org/engage/catima/";
} else if (id == R.id.license) {
url = "https://github.com/TheLastProject/Catima/blob/master/LICENSE";
} else if (id == R.id.repo) {
url = "https://github.com/TheLastProject/Catima/";
} else if (id == R.id.privacy) {
url = "https://catima.app/privacy-policy/";
} else if (id == R.id.report_error) {
url = "https://github.com/TheLastProject/Catima/issues";
} else if (id == R.id.rate) {
url = "https://play.google.com/store/apps/details?id=me.hackerchick.catima";
} else {
return;
}
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
startActivity(intent);
}
}

View File

@@ -460,14 +460,6 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
groupsTabLayout.setVisibility(View.VISIBLE);
}
private void openPrivacyPolicy() {
Intent browserIntent = new Intent(
Intent.ACTION_VIEW,
Uri.parse("https://catima.app/privacy-policy")
);
startActivity(browserIntent);
}
@Override
public boolean onCreateOptionsMenu(Menu inputMenu)
{
@@ -580,12 +572,6 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
return true;
}
if(id == R.id.action_privacy_policy)
{
openPrivacyPolicy();
return true;
}
if (id == R.id.action_about)
{
Intent i = new Intent(getApplicationContext(), AboutActivity.class);

View File

@@ -40,7 +40,7 @@
android:padding="8dp">
<TextView
android:id="@+id/tv1"
android:id="@+id/version_history_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
@@ -52,14 +52,13 @@
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/history"
android:id="@+id/version_history_sub"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="2dp"
android:text="@string/debug_version_fmt"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv1" />
app:layout_constraintTop_toBottomOf="@id/version_history_main" />
<TextView
android:layout_width="wrap_content"
@@ -81,7 +80,7 @@
android:padding="8dp">
<TextView
android:id="@+id/tv2"
android:id="@+id/credits_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
@@ -93,14 +92,13 @@
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/copyright"
android:id="@+id/credits_sub"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="2dp"
android:text="@string/app_copyright_fmt"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv2" />
app:layout_constraintTop_toBottomOf="@id/credits_main" />
<TextView
android:layout_width="wrap_content"
@@ -122,7 +120,7 @@
android:padding="8dp">
<TextView
android:id="@+id/tv4"
android:id="@+id/translate_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
@@ -147,13 +145,13 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/License"
android:id="@+id/license"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp">
<TextView
android:id="@+id/tv5"
android:id="@+id/license_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
@@ -165,6 +163,7 @@
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/license_sub"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="2dp"
@@ -172,7 +171,7 @@
android:layout_marginEnd="20dp"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv5"/>
app:layout_constraintTop_toBottomOf="@id/license_main"/>
<TextView
android:layout_width="wrap_content"
@@ -194,7 +193,7 @@
android:padding="8dp">
<TextView
android:id="@+id/tv6"
android:id="@+id/repo_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
@@ -206,13 +205,14 @@
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/repo_sub"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="2dp"
android:text="@string/on_github"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv6" />
app:layout_constraintTop_toBottomOf="@id/repo_main" />
<TextView
android:layout_width="wrap_content"
@@ -234,25 +234,26 @@
android:padding="8dp">
<TextView
android:id="@+id/tv8"
android:id="@+id/privacy_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
android:padding="2dp"
android:text="@string/privacy_statement"
android:text="@string/privacy_policy"
android:textColor="@color/colorSecondaryText"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/privacy_sub"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="2dp"
android:text="@string/and_data_usage"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv8" />
app:layout_constraintTop_toBottomOf="@id/privacy_main" />
<TextView
android:layout_width="wrap_content"
@@ -274,7 +275,7 @@
android:padding="8dp">
<TextView
android:id="@+id/tv9"
android:id="@+id/rate_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
@@ -286,13 +287,14 @@
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/rate_sub"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="2dp"
android:text="@string/on_google_play"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv9" />
app:layout_constraintTop_toBottomOf="@id/rate_main" />
<TextView
android:layout_width="wrap_content"
@@ -314,7 +316,7 @@
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv10"
android:id="@+id/report_error_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
@@ -324,10 +326,12 @@
android:textSize="18sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/report_error_sub"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/tv10"
app:layout_constraintTop_toBottomOf="@id/report_error_main"
app:layout_constraintStart_toStartOf="parent"
android:textSize="16sp"
android:text="@string/on_github"
@@ -347,5 +351,4 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</ScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@@ -27,10 +27,6 @@
android:id="@+id/action_settings"
android:title="@string/settings"
app:showAsAction="never"/>
<item
android:id="@+id/action_privacy_policy"
android:title="@string/privacy_policy"
app:showAsAction="never"/>
<item
android:id="@+id/action_about"
android:title="@string/about"

View File

@@ -83,9 +83,9 @@
<string name="importOptionApplicationButton">Use another app</string>
<string name="about">About</string>
<string name="app_copyright_fmt" tools:ignore="PluralsCandidate">Copyright © 2019<xliff:g>%d</xliff:g> Sylvia van Os.</string>
<string name="app_copyright_old">Based on Loyalty Card Keychain\ncopyright © 20162020 Branden Archer.</string>
<string name="app_license">Copylefted libre software, licensed GPLv3+.</string>
<string name="app_copyright_fmt" tools:ignore="PluralsCandidate">Copyright © 2019<xliff:g>%d</xliff:g> Sylvia van Os</string>
<string name="app_copyright_old">Based on Loyalty Card Keychain\ncopyright © 20162020 Branden Archer</string>
<string name="app_license">Copylefted libre software, licensed GPLv3+</string>
<string name="about_title_fmt">About <xliff:g id="app_name">%s</xliff:g></string>
<string name="debug_version_fmt">Version: <xliff:g id="version">%s</xliff:g></string>
<string name="app_revision_fmt">Revision Info: <xliff:g id="app_revision_url">%s</xliff:g></string>
@@ -260,7 +260,6 @@
<string name="license">License</string>
<string name="source_repository">Source Repository</string>
<string name="on_github">on Github</string>
<string name="privacy_statement">Privacy Statement</string>
<string name="and_data_usage">and data usage</string>
<string name="rate_this_app">Rate this app</string>
<string name="on_google_play">on Google Play</string>