Skip to content

Commit

Permalink
Merge v5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
kamathprasad9 committed Sep 8, 2023
1 parent 59c8e45 commit 1db8082
Show file tree
Hide file tree
Showing 94 changed files with 6,101 additions and 2,981 deletions.
40 changes: 35 additions & 5 deletions .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,46 @@
on:
schedule:
- cron: "0 20 * * *"
workflow_dispatch:
push:
branches:
- main
paths:
- 'app/**'

name: do-github-release

jobs:

check-app-changes:
runs-on: ubuntu-latest
outputs:
app_changed: ${{ steps.check_app_changes.outputs.app_changed }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
token: ${{secrets.ACTIONS_PAT}}
fetch-depth: 0

- name: Check if app directory changed
id: check_app_changes
run: |
LAST_RELEASE_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "LAST_RELEASE_TAG was $LAST_RELEASE_TAG"
LAST_RELEASE_COMMIT=$(git rev-list -n 1 $LAST_RELEASE_TAG)
echo "LAST_RELEASE_COMMIT was $LAST_RELEASE_COMMIT"
changed_files=$(git diff-tree --no-commit-id --name-only $LAST_RELEASE_COMMIT $GITHUB_SHA | grep '^app' || echo "none")
echo "Changed app files: $changed_files"

if [ "$changed_files" != "none" ]; then
echo "App directory has changed since the last release."
echo "app_changed=true" >> "$GITHUB_OUTPUT"
else
echo "App directory hasn't changed since the last release."
echo "app_changed=false" >> "$GITHUB_OUTPUT"
fi

build-and-release:
runs-on: ubuntu-latest
needs: check-app-changes
if: ${{ needs.check-app-changes.outputs.app_changed == 'true' }}
steps:

- name: Checkout repo
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ name: do-pr-prerelease

jobs:
build-and-upload:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:

Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ gradlew.bat
# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

Expand Down
15 changes: 5 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ private Integer makeVersionCode() {
}

private String makeVersionName() {
if (ext.buildNumber) {
return "${ext.majorVersion}.${ext.minorVersion}.${ext.patchVersion}.${ext.buildNumber}"
}

return "${ext.majorVersion}.${ext.minorVersion}.${ext.patchVersion}"
}

Expand Down Expand Up @@ -72,17 +68,16 @@ android {
buildTypes {

release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
// signingConfig signingConfigs.playStoreConfig //Add your own signing config
minifyEnabled false
debuggable false
//signingConfig signingConfigs.playStoreConfig //Add your own signing config
}

debug {
clean
debuggable true
manifestPlaceholders = [crashlyticsCollectionEnabled: "false"]
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

Expand Down Expand Up @@ -146,7 +141,7 @@ dependencies {

implementation 'com.google.zxing:core:3.3.3'

implementation('com.github.phenoapps:phenolib:v0.9.48')
implementation('com.github.phenoapps:phenolib:v0.9.49')

implementation 'com.google.android.exoplayer:exoplayer:2.17.0'
implementation 'com.arthenica:ffmpeg-kit-min:5.1.LTS'
Expand Down
2 changes: 2 additions & 0 deletions app/proguard-rules.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-keep public class com.fieldbook.tracker.**

2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>
Expand Down
Binary file modified app/src/main/assets/database/sample.db
Binary file not shown.
2 changes: 1 addition & 1 deletion app/src/main/assets/field_import/training_sample.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
plot_id,row,column,plot,replicate,germplasm_name,pedigree
plot_id,row,column,plot,replicate,germplasm,pedigree
23TRN010_0101,1,1,0101,1,Barrie,"BW429, CPSR1//CNR17/3/NI98133/SALWIN"
23TRN010_0102,1,2,0102,1,Oahe,Ransom/SD96240-3-1
23TRN010_0103,1,3,0103,1,Jet,MS Chancellor/SD004072
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
import com.fieldbook.tracker.BuildConfig;
import com.fieldbook.tracker.R;
import com.fieldbook.tracker.preferences.GeneralKeys;
import com.michaelflisar.changelog.ChangelogBuilder;
import com.michaelflisar.changelog.classes.ImportanceChangelogSorter;
import com.michaelflisar.changelog.internal.ChangelogDialogFragment;
import com.mikepenz.aboutlibraries.LibsBuilder;

import java.io.BufferedReader;
Expand Down Expand Up @@ -81,29 +78,18 @@ public MaterialAboutList getMaterialAboutList(@NonNull Context c) {

appCardBuilder.addItem(updateCheckItem);

appCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(getString(R.string.changelog_title))
.icon(R.drawable.ic_about_changelog)
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
showChangelog(false, false);
}
})
.build());
appCardBuilder.addItem(ConvenienceBuilder.createWebsiteActionItem(c,
getResources().getDrawable(R.drawable.book_open_variant),
getString(R.string.about_manual_title),
false,
Uri.parse("https://docs.fieldbook.phenoapps.org/en/latest/field-book.html")));

appCardBuilder.addItem(ConvenienceBuilder.createRateActionItem(c,
getResources().getDrawable(R.drawable.ic_about_rate),
getString(R.string.about_rate),
null
));

appCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.about_help_translate_title)
.icon(R.drawable.ic_about_help_translate)
.setOnClickAction(ConvenienceBuilder.createWebsiteOnClickAction(c, Uri.parse("https://osij6hx.oneskyapp.com/collaboration/project?id=28259")))
.build());

MaterialAboutCard.Builder authorCardBuilder = new MaterialAboutCard.Builder();
authorCardBuilder.title(getString(R.string.about_project_lead_title));

Expand All @@ -120,32 +106,22 @@ public void onClick() {
getString(R.string.about_developer_trife_email),
"Field Book Question"));

authorCardBuilder.addItem(ConvenienceBuilder.createWebsiteActionItem(c,
getResources().getDrawable(R.drawable.ic_about_website),
"PhenoApps.org",
false,
Uri.parse("http://phenoapps.org/")));

MaterialAboutCard.Builder contributorsCardBuilder = new MaterialAboutCard.Builder();
contributorsCardBuilder.title(getString(R.string.about_contributors_title));
contributorsCardBuilder.title(getString(R.string.about_support_title));


contributorsCardBuilder.addItem(ConvenienceBuilder.createWebsiteActionItem(c,
getResources().getDrawable(R.drawable.ic_about_contributors),
getString(R.string.about_contributors_developers_title),
getString(R.string.about_contributors_title),
false,
Uri.parse("https://github.com/PhenoApps/Field-Book/graphs/contributors")));
Uri.parse("https://github.com/PhenoApps/Field-Book#-contributors")));

contributorsCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(getString(R.string.about_translators_title))
.subText(getString(R.string.about_translators_text))
.icon(R.drawable.ic_about_translators)
.build());
contributorsCardBuilder.addItem(ConvenienceBuilder.createWebsiteActionItem(c,
getResources().getDrawable(R.drawable.ic_about_funding),
getString(R.string.about_contributors_funding_title),
false,
Uri.parse("https://github.com/PhenoApps/Field-Book#-funding")));

contributorsCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(getString(R.string.about_contributors_funding_title))
.subText(getString(R.string.about_contributors_funding_text))
.icon(R.drawable.ic_about_funding)
.build());

MaterialAboutCard.Builder technicalCardBuilder = new MaterialAboutCard.Builder();
technicalCardBuilder.title(getString(R.string.about_technical_title));
Expand All @@ -171,15 +147,15 @@ public void onClick() {
final int libStyleId = styleId;

technicalCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.libraries_title)
.text(R.string.about_libraries_title)
.icon(R.drawable.ic_about_libraries)
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
new LibsBuilder()
.withActivityTheme(libStyleId)
.withAutoDetect(true)
.withActivityTitle(getString(R.string.libraries_title))
.withActivityTitle(getString(R.string.about_libraries_title))
.withLicenseShown(true)
.withVersionShown(true)
.start(getApplicationContext());
Expand All @@ -190,23 +166,18 @@ public void onClick() {
MaterialAboutCard.Builder otherAppsCardBuilder = new MaterialAboutCard.Builder();
otherAppsCardBuilder.title(getString(R.string.about_title_other_apps));

otherAppsCardBuilder.addItem(ConvenienceBuilder.createWebsiteActionItem(c,
getResources().getDrawable(R.drawable.ic_about_website),
"PhenoApps.org",
false,
Uri.parse("http://phenoapps.org/")));

otherAppsCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("Coordinate")
.icon(R.drawable.other_ic_coordinate)
.setOnClickAction(openAppOrStore("org.wheatgenetics.coordinate", c))
.build());

otherAppsCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("Inventory")
.icon(R.drawable.other_ic_inventory)
.setOnClickAction(openAppOrStore("org.wheatgenetics.inventory", c))
.build());

otherAppsCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("Verify")
.icon(R.drawable.other_ic_verify)
.build());

otherAppsCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("Intercross")
.icon(R.drawable.other_ic_intercross)
Expand Down Expand Up @@ -335,18 +306,6 @@ private boolean isNewerVersion(String currentVersion, String latestVersion) {
return false;
}

private void showChangelog(Boolean managedShow, Boolean rateButton) {
ChangelogDialogFragment builder = new ChangelogBuilder()
.withUseBulletList(true) // true if you want to show bullets before each changelog row, false otherwise
.withManagedShowOnStart(managedShow) // library will take care to show activity/dialog only if the changelog has new infos and will only show this new infos
.withRateButton(rateButton) // enable this to show a "rate app" button in the dialog => clicking it will open the play store; the parent activity or target fragment can also implement IChangelogRateHandler to handle the button click
.withSummary(false, true) // enable this to show a summary and a "show more" button, the second paramter describes if releases without summary items should be shown expanded or not
.withTitle(getString(R.string.changelog_title)) // provide a custom title if desired, default one is "Changelog <VERSION>"
.withOkButtonLabel(getString(android.R.string.ok)) // provide a custom ok button text if desired, default one is "OK"
.withSorter(new ImportanceChangelogSorter())
.buildAndShowDialog(this, false); // second parameter defines, if the dialog has a dark or light theme
}

@Override
protected CharSequence getActivityTitle() {
return getString(R.string.mal_title_about);
Expand Down
Loading

0 comments on commit 1db8082

Please sign in to comment.