Skip to content

Commit

Permalink
Merge pull request #99 from AdamGuidarini/vc23
Browse files Browse the repository at this point in the history
Vc23
  • Loading branch information
AdamGuidarini authored Jun 12, 2024
2 parents 2f14947 + e9af621 commit eb1d458
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ android {
targetSdkVersion 33
compileSdk 34

versionCode 22
versionName "0.12.3"
versionCode 23
versionName "0.12.4"
resourceConfigurations += ['en', 'de']


Expand Down
8 changes: 7 additions & 1 deletion app/src/main/cpp/Sqlite3Database/Table/Table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ int Table::getCount() {
}

string Table::getItem(string columnName) {
return table.at(columnName).at(currentRow);
try {
return table.at(columnName).at(currentRow);
} catch (exception e) {
cerr << "OUT OF RANGE. No item found in column " << columnName << " in row " << currentRow;

return "0";
}
}

bool Table::isFirst() {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/cpp/Sqlite3Database/Table/Table.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <map>
#include <vector>
#include <string>
#include <iostream>
#include "sqlite3.h"

using namespace std;
Expand Down
8 changes: 6 additions & 2 deletions app/src/main/java/projects/medicationtracker/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ public void afterTextChanged(Editable s) {
private void setDateFormatMenu() {
MaterialAutoCompleteTextView dateSelector = findViewById(R.id.date_format_selector);
String dateFormat = preferences.getString(DATE_FORMAT, DBHelper.DateFormats.MM_DD_YYYY);
String timeFormat = preferences.getString(TIME_FORMAT, DBHelper.TimeFormats._12_HOUR);

dateSelector.setAdapter(createDateFormatMenuAdapter());

Expand All @@ -325,6 +324,8 @@ private void setDateFormatMenu() {
}

dateSelector.setOnItemClickListener((parent, view, position, id) -> {
String timeFormat = preferences.getString(TIME_FORMAT, DBHelper.TimeFormats._12_HOUR);

switch (position) {
case 0:
if (!dateFormat.equals(DBHelper.DateFormats.MM_DD_YYYY)) {
Expand All @@ -338,6 +339,7 @@ private void setDateFormatMenu() {
}

dateSelector.clearFocus();
preferences = db.getPreferences();
});
}

Expand All @@ -347,7 +349,6 @@ private void setDateFormatMenu() {
private void setTimeFormatMenu() {
MaterialAutoCompleteTextView timeSelector = findViewById(R.id.time_format_selector);
String timeFormat = preferences.getString(TIME_FORMAT, DBHelper.TimeFormats._12_HOUR);
String dateFormat = preferences.getString(DATE_FORMAT, DBHelper.DateFormats.DD_MM_YYYY);

timeSelector.setAdapter(createTimeFormatMenuAdapter());

Expand All @@ -361,6 +362,8 @@ private void setTimeFormatMenu() {
}

timeSelector.setOnItemClickListener((parent, view, position, id) -> {
String dateFormat = preferences.getString(DATE_FORMAT, DBHelper.DateFormats.DD_MM_YYYY);

switch (position) {
case 0:
if (!timeFormat.equals(DBHelper.TimeFormats._12_HOUR)) {
Expand All @@ -374,6 +377,7 @@ private void setTimeFormatMenu() {
}

timeSelector.clearFocus();
preferences = db.getPreferences();
});
}

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.4.1'
classpath 'com.android.tools.build:gradle:8.4.2'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down

0 comments on commit eb1d458

Please sign in to comment.