Skip to content

Commit c948d3d

Browse files
authored
Dvaraka (#28)
* upgrade gradle from 3.3 to 8.1 * upgrade to lib-aeapps v5 alpha * upgrade agp * target android api 33 * update travis config
1 parent 5788941 commit c948d3d

File tree

62 files changed

+538
-601
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+538
-601
lines changed

.travis.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,17 @@ language: android
22
dist: precise
33
jdk: oraclejdk8
44

5-
# Install Dependencies
6-
before_install:
7-
- git clone --depth=50 --branch=master https://github.com/midhunhk/ae-apps-library.git ../AeAppsLib
8-
95
# Android settings
106
android:
117
components:
128
- tools
139
# Same version as specified in build.gradle
1410

1511
# Build Tools version
16-
- build-tools-25.0.1
12+
- build-tools-34.0.0
1713

1814
# SDK version to compile against
19-
- android-25
15+
- android-33
2016

2117
# Additional components
2218
- extra-android-m2repository
@@ -27,11 +23,11 @@ android:
2723
licenses:
2824
- '.+'
2925

30-
# Run before runnig the build script
26+
# Run before running the build script
3127
before_script:
32-
- wget http://services.gradle.org/distributions/gradle-3.3-bin.zip
33-
- unzip gradle-3.3-bin.zip
34-
- export GRADLE_HOME=$PWD/gradle-3.3
28+
- wget https://services.gradle.org/distributions/gradle-8.1-bin.zip
29+
- unzip gradle-8.1-bin.zip
30+
- export GRADLE_HOME=$PWD/gradle-8.1
3531
- export PATH=$GRADLE_HOME/bin:$PATH
3632
- echo no | android create avd --force -n test -t android-21 --abi armeabi-v7a
3733
- emulator -avd test -no-skin -no-audio -no-window &

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
_*This project is not in active development or support*_
22

33
# Trip-O-Meter
4-
[![Build Status](https://travis-ci.org/midhunhk/trip-o-meter.svg?branch=camelot)](https://travis-ci.org/midhunhk/trip-o-meter)
4+
[![Build Status](https://travis-ci.org/midhunhk/trip-o-meter.svg?branch=main)](https://travis-ci.org/midhunhk/trip-o-meter)
55
[![Release](https://img.shields.io/github/release/midhunhk/trip-o-meter.svg)](https://github.com/midhunhk/trip-o-meter/releases)
66
[![GitHub commits](https://img.shields.io/github/commits-since/midhunhk/trip-o-meter/v2.0.18.svg)](https://github.com/midhunhk/trip-o-meter)
77
[![Issues](https://img.shields.io/github/issues/midhunhk/trip-o-meter.svg)](https://github.com/midhunhk/trip-o-meter/issues)
@@ -27,7 +27,9 @@ The codenames for development branches are names of Lost or Mythical cities from
2727

2828
The current development branch name is :
2929

30-
***Camelot*** is a castle and court associated with the legendary King Arthur.
30+
***Dvaraka*** was a prosperous and advanced city located along the western coast of present-day Gujarat, India.
31+
It was known for its grandeur, opulence, and divine association with Lord Krishna.
32+
The city is often described as having majestic palaces, gardens, temples, and well-planned streets.
3133

3234
See more - [Codenames](https://github.com/midhunhk/trip-o-meter/wiki/Codenames)
3335

@@ -71,7 +73,7 @@ This project is released under MIT license
7173

7274
MIT License
7375

74-
Copyright (c) 2017 Midhun Harikumar
76+
Copyright (c) 2023 Midhun Harikumar
7577

7678
Permission is hereby granted, free of charge, to any person obtaining a copy
7779
of this software and associated documentation files (the "Software"), to deal

VersionHistory.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
## Trip 'O Meter Version History
2+
## Version 3.0 (Dvaraka)
3+
**Trip O Meter 3.0.0 [Aug 2023]**
4+
* [IMPROVED] Hero image
5+
* [IMPROVED] Target API 33
6+
* [IMPROVED] Use lib-aeapps v5
27

3-
Version 2.1 (Camelot)
4-
----------------------
8+
## Version 2.1 (Camelot)
59
**Trip O Meter 2.1.3 [Jul 2017]**
610
* [FIXED] FAB Layout issues
711
* [ADDED] Unit Testing
812
* [IMPROVED] Layouts and performance
913

10-
Version 2.0 (Balanjar)
11-
----------------------
14+
## Version 2.0 (Balanjar)
1215
**Trip O Meter 2.0.19 [Apr 2017]**
1316
* [FIXED] App crash on selecting contacts without phone numbers
1417

@@ -42,8 +45,7 @@ Version 2.0 (Balanjar)
4245
* [ADDED] Remember and restore last used feature
4346
* [FIXED] NullPointer on orientation changes in trip details
4447

45-
Version 1.0 (Atlantis)
46-
----------------------
48+
## Version 1.0 (Atlantis)
4749
**Trip O Meter 1.0.0 [Jan 2017]**
4850
* [RELEASE] First Public Release
4951

app/build.gradle

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ android {
66
}
77
}
88

9-
compileSdkVersion 25
10-
buildToolsVersion "25.0.1"
119
defaultConfig {
10+
namespace "com.ae.apps.tripmeter"
1211
applicationId "com.ae.apps.tripmeter"
13-
minSdkVersion 16
14-
targetSdkVersion 25
15-
versionCode 14
16-
versionName "2.1.0"
17-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12+
minSdkVersion 21
13+
targetSdkVersion 33
14+
compileSdk 33
15+
versionCode 16
16+
versionName "3.1.0"
17+
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
1818
vectorDrawables.useSupportLibrary = true
1919
}
2020

@@ -25,13 +25,13 @@ android {
2525
}
2626
}
2727

28-
lintOptions {
29-
abortOnError false
30-
}
3128

3229
compileOptions {
3330
}
34-
31+
lint {
32+
abortOnError false
33+
}
34+
/*
3535
applicationVariants.all { variant ->
3636
variant.outputs.each { output ->
3737
def fileName = android.defaultConfig.applicationId + "-" + variant.buildType.name
@@ -40,30 +40,32 @@ android {
4040
output.outputFile = new File(output.outputFile.parent, fileName)
4141
}
4242
}
43+
*/
4344
}
4445

4546
dependencies {
46-
compile fileTree(include: ['*.jar'], dir: 'libs')
47+
// implementation fileTree(include: ['*.jar'], dir: 'libs')
48+
// implementation 'com.github.midhunhk.lib-aeapps::4.1.0'
49+
implementation 'com.github.midhunhk.lib-aeapps:aeapps:v5.0.0-alpha.12'
4750

48-
// The lib project is defined in settings.gradle
49-
compile project(':AeAppsLibrary')
50-
compile 'com.android.support:appcompat-v7:25.3.1'
51-
compile 'com.android.support:design:25.3.1'
52-
compile 'com.android.support:cardview-v7:25.3.1'
53-
compile 'com.android.support:support-v4:25.3.1'
54-
compile 'com.android.support:support-vector-drawable:25.3.1'
55-
compile 'com.android.support:recyclerview-v7:25.3.1'
51+
implementation 'androidx.appcompat:appcompat:1.6.1'
52+
implementation 'com.google.android.material:material:1.9.0'
53+
implementation 'androidx.cardview:cardview:1.0.0'
54+
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
55+
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
56+
implementation 'androidx.recyclerview:recyclerview:1.3.1'
5657

5758
// Unit Tests
58-
testCompile 'junit:junit:4.12'
59-
testCompile 'org.mockito:mockito-core:1.10.19'
59+
testImplementation 'junit:junit:4.13.2'
60+
testImplementation 'org.mockito:mockito-core:5.4.0'
6061

6162
// Instrumented Unit Tests
62-
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
63+
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
6364
exclude group: 'com.android.support', module: 'support-annotations'
6465
})
65-
androidTestCompile 'org.hamcrest:hamcrest-core:1.1'
66-
androidTestCompile 'org.hamcrest:hamcrest-integration:1.1'
67-
androidTestCompile 'org.hamcrest:hamcrest-library:1.1'
66+
androidTestImplementation "androidx.test.ext:junit:1.1.5"
67+
androidTestImplementation 'org.hamcrest:hamcrest-core:2.2'
68+
androidTestImplementation 'org.hamcrest:hamcrest-integration:1.3'
69+
androidTestImplementation 'org.hamcrest:hamcrest-library:2.2'
6870

6971
}

app/src/androidTest/java/com/ae/apps/tripmeter/ExampleInstrumentedTest.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

app/src/androidTest/java/com/ae/apps/tripmeter/activities/FuelCalcTest.java

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,26 @@
11
package com.ae.apps.tripmeter.activities;
22

3-
import android.support.test.espresso.Espresso;
4-
import android.support.test.espresso.matcher.ViewMatchers;
5-
import android.support.test.rule.ActivityTestRule;
6-
import android.support.test.runner.AndroidJUnit4;
3+
import androidx.test.espresso.Espresso;
4+
import androidx.test.espresso.matcher.ViewMatchers;
5+
import androidx.test.runner.AndroidJUnit4;
76

87
import com.ae.apps.tripmeter.R;
9-
import com.ae.apps.tripmeter.activities.MainActivity;
108

11-
import org.junit.Before;
12-
import org.junit.Rule;
139
import org.junit.Test;
1410
import org.junit.runner.RunWith;
1511

16-
import static android.support.test.espresso.action.ViewActions.click;
17-
import static android.support.test.espresso.action.ViewActions.typeText;
18-
import static android.support.test.espresso.action.ViewActions.clearText;
19-
import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard;
20-
import static android.support.test.espresso.assertion.ViewAssertions.matches;
12+
import static androidx.test.espresso.action.ViewActions.click;
13+
import static androidx.test.espresso.action.ViewActions.typeText;
14+
import static androidx.test.espresso.action.ViewActions.clearText;
15+
import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard;
16+
import static androidx.test.espresso.assertion.ViewAssertions.matches;
2117

2218
/**
2319
* Android Unit Test
2420
*/
2521
@RunWith(AndroidJUnit4.class)
2622
public class FuelCalcTest {
2723

28-
@Rule
29-
public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<>(
30-
MainActivity.class);
31-
3224
@Test
3325
public void testTotalFuelAndPrice() {
3426
String distance = "100";

app/src/main/AndroidManifest.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest package="com.ae.apps.tripmeter"
3-
xmlns:android="http://schemas.android.com/apk/res/android"
4-
android:versionCode="8"
5-
android:versionName="@string/app_version_name">
2+
<manifest
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:versionCode="8"
5+
android:versionName="@string/app_version_name">
66

77
<uses-permission android:name="android.permission.READ_CONTACTS" />
88
<!--<uses-permission android:name="android.permission.READ_PROFILE" />-->
@@ -16,7 +16,7 @@
1616

1717
<activity
1818
android:name=".activities.MainActivity"
19-
android:label="@string/app_name"
19+
android:exported="true"
2020
android:theme="@style/AppTheme.NoActionBar.SplashTheme">
2121
<intent-filter>
2222
<action android:name="android.intent.action.MAIN"/>

app/src/main/java/com/ae/apps/tripmeter/activities/AboutActivity.java

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,64 +23,64 @@ of this software and associated documentation files (the "Software"), to deal
2323
*/
2424
package com.ae.apps.tripmeter.activities;
2525

26-
import android.app.AlertDialog;
2726
import android.content.Context;
28-
import android.content.DialogInterface;
2927
import android.content.Intent;
3028
import android.net.Uri;
3129
import android.os.Bundle;
32-
import android.support.v7.app.AppCompatActivity;
33-
import android.support.v7.widget.Toolbar;
34-
import android.view.View;
30+
import androidx.appcompat.app.AppCompatActivity;
31+
import androidx.appcompat.widget.Toolbar;
32+
3533
import android.widget.Button;
3634

37-
import com.ae.apps.common.activities.ToolBarBaseActivity;
38-
import com.ae.apps.common.utils.DialogUtils;
35+
import com.ae.apps.lib.common.utils.DialogUtils;
3936
import com.ae.apps.tripmeter.R;
4037

38+
import java.util.Objects;
39+
4140
/**
4241
* The About Activity
4342
*/
44-
public class AboutActivity extends ToolBarBaseActivity {
43+
public class AboutActivity extends AppCompatActivity {
4544

4645
@Override
4746
protected void onCreate(Bundle savedInstanceState) {
4847
super.onCreate(savedInstanceState);
4948

50-
displayHomeAsUp();
49+
setContentView(R.layout.activity_about);
50+
51+
setSupportActionBar(findViewById(R.id.toolbar));
52+
53+
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
54+
getSupportActionBar().setHomeButtonEnabled(true);
5155

5256
// Navigate to GitHub Page
53-
Button viewSourceCodeBtn = (Button) findViewById(R.id.viewSourceCode);
54-
viewSourceCodeBtn.setOnClickListener(new View.OnClickListener() {
55-
@Override
56-
public void onClick(View view) {
57-
String url = getString(R.string.github_source_visible_url);
58-
Intent intent = new Intent(Intent.ACTION_VIEW);
59-
intent.setData(Uri.parse(url));
60-
startActivity(intent);
61-
}
57+
Button viewSourceCodeBtn = findViewById(R.id.viewSourceCode);
58+
viewSourceCodeBtn.setOnClickListener(view -> {
59+
String url = getString(R.string.github_source_visible_url);
60+
Intent intent = new Intent(Intent.ACTION_VIEW);
61+
intent.setData(Uri.parse(url));
62+
startActivity(intent);
6263
});
6364

6465
final Context context = this;
6566

6667
// Show the License as a dialog
67-
Button viewLicenseBtn = (Button) findViewById(R.id.viewLicense);
68-
viewLicenseBtn.setOnClickListener(new View.OnClickListener(){
69-
@Override
70-
public void onClick(View view) {
71-
DialogUtils.showMaterialInfoDialog(context, R.string.menu_license,
72-
R.string.str_license, android.R.string.ok);
73-
}
74-
});
75-
}
68+
Button viewLicenseBtn = findViewById(R.id.viewLicense);
69+
viewLicenseBtn.setOnClickListener(view -> DialogUtils.showMaterialInfoDialog(context, R.string.menu_license,
70+
R.string.str_license, android.R.string.ok));
71+
72+
// Find the toolbar and set it as action bar
73+
Toolbar mToolbar = findViewById(R.id.toolbar);
74+
if (null != mToolbar) {
75+
setSupportActionBar(mToolbar);
76+
}
7677

77-
@Override
78-
protected int getToolbarResourceId() {
79-
return R.id.toolbar;
8078
}
8179

8280
@Override
83-
protected int getLayoutResourceId() {
84-
return R.layout.activity_about;
81+
public boolean onSupportNavigateUp() {
82+
onBackPressed();
83+
return true;
8584
}
85+
8686
}

app/src/main/java/com/ae/apps/tripmeter/activities/AppCompatPreferenceActivity.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
import android.content.res.Configuration;
44
import android.os.Bundle;
55
import android.preference.PreferenceActivity;
6-
import android.support.annotation.LayoutRes;
7-
import android.support.annotation.Nullable;
8-
import android.support.v7.app.ActionBar;
9-
import android.support.v7.app.AppCompatDelegate;
10-
import android.support.v7.widget.Toolbar;
6+
import androidx.annotation.LayoutRes;
7+
import androidx.annotation.Nullable;
8+
import androidx.appcompat.app.ActionBar;
9+
import androidx.appcompat.app.AppCompatDelegate;
10+
import androidx.appcompat.widget.Toolbar;
1111
import android.view.MenuInflater;
1212
import android.view.View;
1313
import android.view.ViewGroup;

0 commit comments

Comments
 (0)