Skip to content

Commit

Permalink
Merge pull request #111 from hyperrail/development
Browse files Browse the repository at this point in the history
v1.1.0
  • Loading branch information
Bertware authored Jul 18, 2019
2 parents 27e5e40 + b824a96 commit e1cd2da
Show file tree
Hide file tree
Showing 115 changed files with 514 additions and 1,078 deletions.
32 changes: 16 additions & 16 deletions Hyperrail/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'io.fabric'

def VERSION_CODE = 45
def VERSION_NAME = '1.1.0-beta2'
def VERSION_CODE = 47
def VERSION_NAME = '1.1.0'

android {
compileSdkVersion 28
Expand All @@ -20,7 +20,7 @@ android {
targetSdkVersion 28
versionCode VERSION_CODE
versionName VERSION_NAME
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
Expand All @@ -44,10 +44,10 @@ android {
}

dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0-alpha4', {
exclude group: 'com.android.support', module: 'support-annotations'
})

Expand All @@ -57,22 +57,22 @@ dependencies {

implementation 'com.android.volley:volley:1.1.0@aar'
implementation 'joda-time:joda-time:2.9.9'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:exifinterface:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.firebase:firebase-perf:16.2.5'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.exifinterface:exifinterface:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.firebase:firebase-perf:18.0.1'
implementation 'com.google.firebase:firebase-core:17.0.1'
implementation 'com.squareup.picasso:picasso:2.71828'

testImplementation 'junit:junit:4.12'
testImplementation 'org.json:json:20160810'
testImplementation "org.mockito:mockito-core:2.18.3"
// org.json is included with Android, but Android.jar can not be used from unit tests
androidTestImplementation 'com.android.support.test.espresso:espresso-contrib:2.2.2', {
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.0-alpha4', {
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'design'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
import android.graphics.Color;
import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES;
import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.support.v4.app.NotificationCompat.Builder;
import android.support.v4.app.NotificationCompat.DecoratedCustomViewStyle;
import android.support.v4.content.ContextCompat;
import androidx.annotation.NonNull;
import com.google.android.material.snackbar.Snackbar;
import androidx.core.app.NotificationCompat.Builder;
import androidx.core.app.NotificationCompat.DecoratedCustomViewStyle;
import androidx.core.content.ContextCompat;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.android.material.tabs.TabLayout;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.ViewPager;
import androidx.appcompat.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
Expand Down Expand Up @@ -139,7 +139,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
/**
* A placeholder fragment containing a simple view.
*/
public static class FirstLaunchFragment extends android.support.v4.app.Fragment {
public static class FirstLaunchFragment extends Fragment {
private static final String ARG_DESCRIPTION = "description";
private static final String ARG_IMG = "image";
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,20 @@
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.IntDef;
import android.support.annotation.NonNull;
import android.support.annotation.StringRes;
import android.support.design.widget.NavigationView;
import android.support.v4.app.Fragment;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Gravity;
import android.view.MenuItem;
import android.view.View;

import com.google.android.material.navigation.NavigationView;

import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
import androidx.annotation.StringRes;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.GravityCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.Fragment;
import be.hyperrail.android.R;
import be.hyperrail.android.fragments.FeedbackFragment;
import be.hyperrail.android.fragments.LiveboardSearchFragment;
Expand Down Expand Up @@ -239,7 +240,7 @@ private void setView(@ViewType int i, Bundle args) {
android.R.animator.fade_in, android.R.animator.fade_out).commit();

// Close drawer before loading next fragment
mDrawerLayout.closeDrawer(Gravity.START);
mDrawerLayout.closeDrawer(GravityCompat.START);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.Toolbar;
import android.widget.RemoteViews;

import be.hyperrail.android.R;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.preference.PreferenceFragment;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

import be.hyperrail.android.R;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.app.ActivityCompat;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
Expand Down Expand Up @@ -67,13 +68,8 @@ protected void onCreate(Bundle savedInstanceState) {
mStation = (StopLocation) getIntent().getSerializableExtra("station");

findViewById(R.id.floating_action_button).setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(LiveboardActivity.createIntent(StationActivity.this,
new LiveboardRequest(mStation, QueryTimeDefinition.EQUAL_OR_LATER, LiveboardType.DEPARTURES, null)));
}
}
v -> startActivity(LiveboardActivity.createIntent(StationActivity.this,
new LiveboardRequest(mStation, QueryTimeDefinition.EQUAL_OR_LATER, LiveboardType.DEPARTURES, null)))
);

setTitle(mStation.getLocalizedName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@
import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Toast;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.ViewPager;

import com.google.android.material.snackbar.Snackbar;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.google.firebase.analytics.FirebaseAnalytics.Event;
import com.google.firebase.analytics.FirebaseAnalytics.Param;
Expand Down Expand Up @@ -68,7 +69,7 @@ private Intent createShortcutIntent() {
Intent i = new Intent(this, LiveboardActivity.class);
i.putExtra("shortcut", true); // this variable allows to detect launches from shortcuts
i.putExtra("station",
mRequest.getStation().getHafasId()); // shortcut intents should not contain application specific classes - only pass the station ID
mRequest.getStation().getHafasId()); // shortcut intents should not contain application specific classes - only pass the station ID
return i;
}

Expand Down Expand Up @@ -154,27 +155,28 @@ public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case id.action_from:
startActivity(MainActivity.createRouteFromIntent(getApplicationContext(),
mRequest.getStation().getName()));
mRequest.getStation().getName()));
return true;

case id.action_to:
startActivity(MainActivity.createRouteToIntent(getApplicationContext(),
mRequest.getStation().getName()));
mRequest.getStation().getName()));
return true;

case id.action_details:
startActivity(StationActivity.createIntent(getApplicationContext(),
mRequest.getStation()));
mRequest.getStation()));
return true;

case id.action_shortcut:
Intent shortcutIntent = createShortcutIntent();
ShortcutHelper.createShortcut(this,
vLayoutRoot,
shortcutIntent,
mRequest.getStation().getLocalizedName(),
"Departures from " + mRequest.getStation().getLocalizedName(),
R.mipmap.ic_shortcut_liveboard);
vLayoutRoot,
shortcutIntent,
mRequest.getStation().getSemanticId(),
mRequest.getStation().getLocalizedName(),
"Departures from " + mRequest.getStation().getLocalizedName(),
R.mipmap.ic_shortcut_liveboard);
return true;

default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
import android.net.NetworkInfo;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.ColorRes;
import android.support.annotation.LayoutRes;
import android.support.annotation.MenuRes;
import android.support.annotation.StringRes;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import androidx.annotation.ColorRes;
import androidx.annotation.LayoutRes;
import androidx.annotation.MenuRes;
import androidx.annotation.StringRes;
import androidx.core.content.ContextCompat;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;

import androidx.annotation.NonNull;

import com.google.android.material.snackbar.Snackbar;
import com.google.firebase.analytics.FirebaseAnalytics;

import org.joda.time.DateTime;
Expand Down Expand Up @@ -122,11 +123,12 @@ public boolean onOptionsItemSelected(MenuItem item) {
case R.id.action_shortcut:
Intent shortcutIntent = createShortcutIntent();
ShortcutHelper.createShortcut(this,
vLayoutRoot,
shortcutIntent,
mRequest.getOrigin().getLocalizedName() + " - " + mRequest.getDestination().getLocalizedName(),
"Route from " + mRequest.getOrigin().getLocalizedName() + " to " + mRequest.getDestination().getLocalizedName(),
R.mipmap.ic_launcher);
vLayoutRoot,
shortcutIntent,
mRequest.getOrigin().getSemanticId() + "::" + mRequest.getDestination().getSemanticId(),
mRequest.getOrigin().getLocalizedName() + " - " + mRequest.getDestination().getLocalizedName(),
"Route from " + mRequest.getOrigin().getLocalizedName() + " to " + mRequest.getDestination().getLocalizedName(),
R.mipmap.ic_launcher);
return true;

default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import androidx.fragment.app.Fragment;

import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.view.MenuItem;
import android.view.View;

import com.crashlytics.android.Crashlytics;
import com.google.android.material.snackbar.Snackbar;
import com.google.firebase.analytics.FirebaseAnalytics;

import org.joda.time.DateTime;
Expand Down Expand Up @@ -86,6 +86,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
ShortcutHelper.createShortcut(this,
vLayoutRoot,
shortcutIntent,
mRequest.getVehicleId(),
IrailVehicleJourneyStub.getVehicleName(mRequest.getVehicleId()),
"VehicleJourney " + IrailVehicleJourneyStub.getVehicleName(mRequest.getVehicleId()),
R.mipmap.ic_shortcut_train);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

package be.hyperrail.android.adapter;

import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import android.content.Context;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Loading

0 comments on commit e1cd2da

Please sign in to comment.