Merge pull request #5 from FuegoFro/material_libraries
Replace 3rd party shims with Google's support libraries
This commit is contained in:
commit
4ee80b3f90
6
.gitmodules
vendored
6
.gitmodules
vendored
@ -1,9 +1,3 @@
|
|||||||
[submodule "holoeverywhere"]
|
|
||||||
path = holoeverywhere
|
|
||||||
url = https://github.com/Prototik/HoloEverywhere.git
|
|
||||||
[submodule "nineoldandroids"]
|
|
||||||
path = nineoldandroids
|
|
||||||
url = https://github.com/JakeWharton/NineOldAndroids
|
|
||||||
[submodule "drag-sort-listview"]
|
[submodule "drag-sort-listview"]
|
||||||
path = drag-sort-listview
|
path = drag-sort-listview
|
||||||
url = https://github.com/bauerca/drag-sort-listview
|
url = https://github.com/bauerca/drag-sort-listview
|
||||||
|
39
.project
39
.project
@ -1,39 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<projectDescription>
|
|
||||||
<name>BARTRunner</name>
|
|
||||||
<comment></comment>
|
|
||||||
<projects>
|
|
||||||
</projects>
|
|
||||||
<buildSpec>
|
|
||||||
<buildCommand>
|
|
||||||
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
<buildCommand>
|
|
||||||
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
<buildCommand>
|
|
||||||
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
<buildCommand>
|
|
||||||
<name>net.rim.ajde.internal.verifier</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
</buildSpec>
|
|
||||||
<natures>
|
|
||||||
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
|
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
|
||||||
<nature>net.rim.ajde.BlackBerryAndroidNature</nature>
|
|
||||||
</natures>
|
|
||||||
</projectDescription>
|
|
@ -2,17 +2,21 @@ apply plugin: 'com.android.application'
|
|||||||
apply plugin: 'com.neenbedankt.android-apt'
|
apply plugin: 'com.neenbedankt.android-apt'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
compile project(':drag-sort-listview-gradle')
|
||||||
compile project(":holoeverywhere-gradle")
|
compile 'commons-io:commons-io:2.4'
|
||||||
compile project(":holoeverywhere-preferences-gradle")
|
compile 'org.apache.commons:commons-lang3:3.4'
|
||||||
compile project(":drag-sort-listview-gradle")
|
compile 'com.fasterxml.jackson.core:jackson-databind:2.6.1'
|
||||||
|
compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
|
||||||
|
compile 'com.code-troopers.betterpickers:library:2.0.0'
|
||||||
|
|
||||||
|
compile 'com.android.support:appcompat-v7:22.2.1'
|
||||||
|
|
||||||
apt 'com.googlecode.androidannotations:androidannotations:2.7'
|
apt 'com.googlecode.androidannotations:androidannotations:2.7'
|
||||||
compile "com.googlecode.androidannotations:androidannotations-api:2.7"
|
compile "com.googlecode.androidannotations:androidannotations-api:2.7"
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 17
|
compileSdkVersion 22
|
||||||
buildToolsVersion "22.0.1"
|
buildToolsVersion "22.0.1"
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
@ -20,8 +24,13 @@ android {
|
|||||||
targetCompatibility JavaVersion.VERSION_1_7
|
targetCompatibility JavaVersion.VERSION_1_7
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
defaultConfig {
|
||||||
main.java.srcDirs += ["../nineoldandroids/library/src"]
|
versionName "2.2.4"
|
||||||
|
versionCode 31
|
||||||
|
|
||||||
|
// TODO(fuegofro) - bring this back down to 8 if it's easy by using a different number picker library
|
||||||
|
minSdkVersion 9
|
||||||
|
targetSdkVersion 22
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
@ -31,8 +40,10 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
|
exclude 'META-INF/LICENSE'
|
||||||
exclude 'META-INF/LICENSE.txt'
|
exclude 'META-INF/LICENSE.txt'
|
||||||
exclude 'META-INF/license.txt'
|
exclude 'META-INF/license.txt'
|
||||||
|
exclude 'META-INF/NOTICE'
|
||||||
exclude 'META-INF/NOTICE.txt'
|
exclude 'META-INF/NOTICE.txt'
|
||||||
exclude 'META-INF/notice.txt'
|
exclude 'META-INF/notice.txt'
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -2,22 +2,19 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.dougkeen.bart"
|
package="com.dougkeen.bart"
|
||||||
android:installLocation="auto"
|
android:installLocation="auto"
|
||||||
android:versionCode="31"
|
>
|
||||||
android:versionName="2.2.4">
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
<uses-permission android:name="android.permission.VIBRATE" />
|
<uses-permission android:name="android.permission.VIBRATE" />
|
||||||
|
|
||||||
<uses-sdk
|
|
||||||
android:minSdkVersion="8"
|
|
||||||
android:targetSdkVersion="14" />
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".BartRunnerApplication_"
|
android:name=".BartRunnerApplication_"
|
||||||
android:icon="@drawable/icon"
|
android:icon="@drawable/icon"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme"
|
||||||
|
android:allowBackup="true"
|
||||||
|
>
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.RoutesListActivity_"
|
android:name=".activities.RoutesListActivity_"
|
||||||
android:configChanges="orientation|keyboardHidden"
|
android:configChanges="orientation|keyboardHidden"
|
||||||
|
@ -8,9 +8,9 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.holoeverywhere.app.Application;
|
|
||||||
|
|
||||||
import android.app.AlarmManager;
|
import android.app.AlarmManager;
|
||||||
|
import android.app.Application;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.media.MediaPlayer;
|
import android.media.MediaPlayer;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
|
@ -1,20 +1,21 @@
|
|||||||
package com.dougkeen.bart.activities;
|
package com.dougkeen.bart.activities;
|
||||||
|
|
||||||
import org.holoeverywhere.LayoutInflater;
|
import android.annotation.SuppressLint;
|
||||||
import org.holoeverywhere.app.AlertDialog;
|
import android.app.Dialog;
|
||||||
import org.holoeverywhere.app.Dialog;
|
|
||||||
import org.holoeverywhere.app.DialogFragment;
|
|
||||||
import org.holoeverywhere.widget.ArrayAdapter;
|
|
||||||
import org.holoeverywhere.widget.Spinner;
|
|
||||||
import org.holoeverywhere.widget.Toast;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.SharedPreferences.Editor;
|
import android.content.SharedPreferences.Editor;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
import android.support.v4.app.DialogFragment;
|
||||||
import android.support.v4.app.FragmentActivity;
|
import android.support.v4.app.FragmentActivity;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.Spinner;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.dougkeen.bart.R;
|
import com.dougkeen.bart.R;
|
||||||
import com.dougkeen.bart.model.Station;
|
import com.dougkeen.bart.model.Station;
|
||||||
@ -57,22 +58,23 @@ public abstract class AbstractRouteSelectionFragment extends DialogFragment {
|
|||||||
|
|
||||||
final Dialog dialog = getDialog();
|
final Dialog dialog = getDialog();
|
||||||
final FragmentActivity activity = getActivity();
|
final FragmentActivity activity = getActivity();
|
||||||
ArrayAdapter<Station> originSpinnerAdapter = new ArrayAdapter<Station>(
|
|
||||||
activity, R.layout.simple_spinner_item,
|
ArrayAdapter<Station> originSpinnerAdapter = new ArrayAdapter<>(
|
||||||
|
activity, R.layout.support_simple_spinner_dropdown_item,
|
||||||
Station.getStationList());
|
Station.getStationList());
|
||||||
originSpinnerAdapter
|
originSpinnerAdapter
|
||||||
.setDropDownViewResource(R.layout.simple_spinner_dropdown_item);
|
.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);
|
||||||
|
|
||||||
final Spinner originSpinner = (Spinner) dialog
|
final Spinner originSpinner = (Spinner) dialog
|
||||||
.findViewById(R.id.origin_spinner);
|
.findViewById(R.id.origin_spinner);
|
||||||
originSpinner.setAdapter(originSpinnerAdapter);
|
originSpinner.setAdapter(originSpinnerAdapter);
|
||||||
originSpinner.setSelection(lastSelectedOriginPosition);
|
originSpinner.setSelection(lastSelectedOriginPosition);
|
||||||
|
|
||||||
ArrayAdapter<Station> destinationSpinnerAdapter = new ArrayAdapter<Station>(
|
ArrayAdapter<Station> destinationSpinnerAdapter = new ArrayAdapter<>(
|
||||||
activity, R.layout.simple_spinner_item,
|
activity, R.layout.support_simple_spinner_dropdown_item,
|
||||||
Station.getStationList());
|
Station.getStationList());
|
||||||
destinationSpinnerAdapter
|
destinationSpinnerAdapter
|
||||||
.setDropDownViewResource(R.layout.simple_spinner_dropdown_item);
|
.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);
|
||||||
|
|
||||||
final Spinner destinationSpinner = (Spinner) dialog
|
final Spinner destinationSpinner = (Spinner) dialog
|
||||||
.findViewById(R.id.destination_spinner);
|
.findViewById(R.id.destination_spinner);
|
||||||
@ -80,12 +82,14 @@ public abstract class AbstractRouteSelectionFragment extends DialogFragment {
|
|||||||
destinationSpinner.setSelection(lastSelectedDestinationPosition);
|
destinationSpinner.setSelection(lastSelectedDestinationPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||||
final FragmentActivity activity = getActivity();
|
final FragmentActivity activity = getActivity();
|
||||||
|
|
||||||
final View dialogView = LayoutInflater.inflate(activity,
|
@SuppressLint("InflateParams")
|
||||||
R.layout.route_form);
|
final View dialogView = LayoutInflater.from(activity)
|
||||||
|
.inflate(R.layout.route_form, null /* root */);
|
||||||
|
|
||||||
return new AlertDialog.Builder(activity)
|
return new AlertDialog.Builder(activity)
|
||||||
.setTitle(mTitle)
|
.setTitle(mTitle)
|
||||||
@ -117,6 +121,7 @@ public abstract class AbstractRouteSelectionFragment extends DialogFragment {
|
|||||||
|
|
||||||
Station origin = (Station) originSpinner.getSelectedItem();
|
Station origin = (Station) originSpinner.getSelectedItem();
|
||||||
Station destination = (Station) destinationSpinner.getSelectedItem();
|
Station destination = (Station) destinationSpinner.getSelectedItem();
|
||||||
|
// TODO(fuegofro) - convert these toasts to error messages on the dialog.
|
||||||
if (origin == null) {
|
if (origin == null) {
|
||||||
Toast.makeText(dialog.getContext(),
|
Toast.makeText(dialog.getContext(),
|
||||||
com.dougkeen.bart.R.string.error_null_origin,
|
com.dougkeen.bart.R.string.error_null_origin,
|
||||||
|
@ -9,6 +9,8 @@ import com.dougkeen.bart.model.Station;
|
|||||||
import com.dougkeen.bart.model.StationPair;
|
import com.dougkeen.bart.model.StationPair;
|
||||||
|
|
||||||
public class AddRouteDialogFragment extends AbstractRouteSelectionFragment {
|
public class AddRouteDialogFragment extends AbstractRouteSelectionFragment {
|
||||||
|
public static final String TAG = "ADD_ROUTE_DIALOG_FRAGMENT_TAG";
|
||||||
|
|
||||||
public AddRouteDialogFragment() {
|
public AddRouteDialogFragment() {
|
||||||
super(BartRunnerApplication.getAppContext().getString(
|
super(BartRunnerApplication.getAppContext().getString(
|
||||||
R.string.add_route));
|
R.string.add_route));
|
||||||
|
@ -10,6 +10,8 @@ import com.dougkeen.bart.model.StationPair;
|
|||||||
|
|
||||||
public class QuickRouteDialogFragment extends AbstractRouteSelectionFragment {
|
public class QuickRouteDialogFragment extends AbstractRouteSelectionFragment {
|
||||||
|
|
||||||
|
public static final String TAG = "QUICK_ROUTE_DIALOG_FRAGMENT_TAG";
|
||||||
|
|
||||||
public QuickRouteDialogFragment() {
|
public QuickRouteDialogFragment() {
|
||||||
super(BartRunnerApplication.getAppContext().getString(
|
super(BartRunnerApplication.getAppContext().getString(
|
||||||
R.string.quick_departure_lookup));
|
R.string.quick_departure_lookup));
|
||||||
|
@ -3,26 +3,25 @@ package com.dougkeen.bart.activities;
|
|||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
import org.holoeverywhere.app.Activity;
|
|
||||||
import org.holoeverywhere.app.AlertDialog;
|
|
||||||
import org.holoeverywhere.app.AlertDialog.Builder;
|
|
||||||
import org.holoeverywhere.app.DialogFragment;
|
|
||||||
import org.holoeverywhere.widget.TextView;
|
|
||||||
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.ActivityCompat;
|
import android.support.v4.app.ActivityCompat;
|
||||||
|
import android.support.v4.app.DialogFragment;
|
||||||
|
import android.support.v4.view.MenuItemCompat;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.support.v7.view.ActionMode;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuInflater;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.ListAdapter;
|
import android.widget.ListAdapter;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.actionbarsherlock.view.ActionMode;
|
|
||||||
import com.actionbarsherlock.view.Menu;
|
|
||||||
import com.actionbarsherlock.view.MenuInflater;
|
|
||||||
import com.actionbarsherlock.view.MenuItem;
|
|
||||||
import com.dougkeen.bart.BartRunnerApplication;
|
import com.dougkeen.bart.BartRunnerApplication;
|
||||||
import com.dougkeen.bart.R;
|
import com.dougkeen.bart.R;
|
||||||
import com.dougkeen.bart.controls.Ticker;
|
import com.dougkeen.bart.controls.Ticker;
|
||||||
@ -49,7 +48,7 @@ import com.googlecode.androidannotations.annotations.rest.RestService;
|
|||||||
import com.mobeta.android.dslv.DragSortListView;
|
import com.mobeta.android.dslv.DragSortListView;
|
||||||
|
|
||||||
@EActivity(R.layout.main)
|
@EActivity(R.layout.main)
|
||||||
public class RoutesListActivity extends Activity implements TickSubscriber {
|
public class RoutesListActivity extends AppCompatActivity implements TickSubscriber {
|
||||||
private static final String NO_DELAYS_REPORTED = "No delays reported";
|
private static final String NO_DELAYS_REPORTED = "No delays reported";
|
||||||
|
|
||||||
private static final TimeZone PACIFIC_TIME = TimeZone
|
private static final TimeZone PACIFIC_TIME = TimeZone
|
||||||
@ -88,7 +87,7 @@ public class RoutesListActivity extends Activity implements TickSubscriber {
|
|||||||
@Click(R.id.quickLookupButton)
|
@Click(R.id.quickLookupButton)
|
||||||
void quickLookupButtonClick() {
|
void quickLookupButtonClick() {
|
||||||
DialogFragment dialog = new QuickRouteDialogFragment();
|
DialogFragment dialog = new QuickRouteDialogFragment();
|
||||||
dialog.show(getSupportFragmentManager().beginTransaction());
|
dialog.show(getSupportFragmentManager(), QuickRouteDialogFragment.TAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ItemClick(android.R.id.list)
|
@ItemClick(android.R.id.list)
|
||||||
@ -273,8 +272,9 @@ public class RoutesListActivity extends Activity implements TickSubscriber {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
MenuInflater inflater = getSupportMenuInflater();
|
MenuInflater inflater = getMenuInflater();
|
||||||
inflater.inflate(R.menu.routes_list_menu, menu);
|
inflater.inflate(R.menu.routes_list_menu, menu);
|
||||||
return super.onCreateOptionsMenu(menu);
|
return super.onCreateOptionsMenu(menu);
|
||||||
}
|
}
|
||||||
@ -282,11 +282,12 @@ public class RoutesListActivity extends Activity implements TickSubscriber {
|
|||||||
private MenuItem elevatorMenuItem;
|
private MenuItem elevatorMenuItem;
|
||||||
private View origElevatorActionView;
|
private View origElevatorActionView;
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
int itemId = item.getItemId();
|
int itemId = item.getItemId();
|
||||||
if (itemId == R.id.add_favorite_menu_button) {
|
if (itemId == R.id.add_favorite_menu_button) {
|
||||||
new AddRouteDialogFragment().show(getSupportFragmentManager()
|
new AddRouteDialogFragment().show(getSupportFragmentManager(),
|
||||||
.beginTransaction());
|
AddRouteDialogFragment.TAG);
|
||||||
return true;
|
return true;
|
||||||
} else if (itemId == R.id.view_system_map_button) {
|
} else if (itemId == R.id.view_system_map_button) {
|
||||||
startActivity(new Intent(this, ViewMapActivity.class));
|
startActivity(new Intent(this, ViewMapActivity.class));
|
||||||
@ -294,8 +295,8 @@ public class RoutesListActivity extends Activity implements TickSubscriber {
|
|||||||
} else if (itemId == R.id.elevator_button) {
|
} else if (itemId == R.id.elevator_button) {
|
||||||
elevatorMenuItem = item;
|
elevatorMenuItem = item;
|
||||||
fetchElevatorInfo();
|
fetchElevatorInfo();
|
||||||
origElevatorActionView = elevatorMenuItem.getActionView();
|
origElevatorActionView = MenuItemCompat.getActionView(elevatorMenuItem);
|
||||||
elevatorMenuItem.setActionView(R.layout.progress_spinner);
|
MenuItemCompat.setActionView(elevatorMenuItem, R.layout.progress_spinner);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
@ -336,7 +337,7 @@ public class RoutesListActivity extends Activity implements TickSubscriber {
|
|||||||
if (messageText == null) {
|
if (messageText == null) {
|
||||||
hideAlertMessage();
|
hideAlertMessage();
|
||||||
return;
|
return;
|
||||||
} else if (messageText == NO_DELAYS_REPORTED) {
|
} else if (messageText.equals(NO_DELAYS_REPORTED)) {
|
||||||
alertMessages.setCompoundDrawablesWithIntrinsicBounds(
|
alertMessages.setCompoundDrawablesWithIntrinsicBounds(
|
||||||
R.drawable.ic_allgood, 0, 0, 0);
|
R.drawable.ic_allgood, 0, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
@ -360,19 +361,19 @@ public class RoutesListActivity extends Activity implements TickSubscriber {
|
|||||||
@UiThread
|
@UiThread
|
||||||
void resetElevatorMenuGraphic() {
|
void resetElevatorMenuGraphic() {
|
||||||
ActivityCompat.invalidateOptionsMenu(this);
|
ActivityCompat.invalidateOptionsMenu(this);
|
||||||
elevatorMenuItem.setActionView(origElevatorActionView);
|
MenuItemCompat.setActionView(elevatorMenuItem, origElevatorActionView);
|
||||||
}
|
}
|
||||||
|
|
||||||
@UiThread
|
@UiThread
|
||||||
void showElevatorMessage(String message) {
|
void showElevatorMessage(String message) {
|
||||||
Builder builder = new AlertDialog.Builder(this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
builder.setMessage(message);
|
builder.setMessage(message);
|
||||||
builder.setTitle("Elevator status");
|
builder.setTitle("Elevator status");
|
||||||
builder.show();
|
builder.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startContextualActionMode() {
|
private void startContextualActionMode() {
|
||||||
mActionMode = startActionMode(new RouteActionMode());
|
mActionMode = startSupportActionMode(new RouteActionMode());
|
||||||
mActionMode.setTitle(mCurrentlySelectedStationPair.getOrigin().name);
|
mActionMode.setTitle(mCurrentlySelectedStationPair.getOrigin().name);
|
||||||
mActionMode.setSubtitle("to "
|
mActionMode.setSubtitle("to "
|
||||||
+ mCurrentlySelectedStationPair.getDestination().name);
|
+ mCurrentlySelectedStationPair.getDestination().name);
|
||||||
|
@ -1,25 +1,27 @@
|
|||||||
package com.dougkeen.bart.activities;
|
package com.dougkeen.bart.activities;
|
||||||
|
|
||||||
import org.holoeverywhere.LayoutInflater;
|
import android.annotation.SuppressLint;
|
||||||
import org.holoeverywhere.app.AlertDialog;
|
import android.app.Dialog;
|
||||||
import org.holoeverywhere.app.Dialog;
|
|
||||||
import org.holoeverywhere.app.DialogFragment;
|
|
||||||
import org.holoeverywhere.widget.NumberPicker;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.SharedPreferences.Editor;
|
import android.content.SharedPreferences.Editor;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
import android.support.v4.app.DialogFragment;
|
||||||
import android.support.v4.app.FragmentActivity;
|
import android.support.v4.app.FragmentActivity;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
|
import com.codetroopers.betterpickers.numberpicker.NumberPicker;
|
||||||
import com.dougkeen.bart.BartRunnerApplication;
|
import com.dougkeen.bart.BartRunnerApplication;
|
||||||
import com.dougkeen.bart.R;
|
import com.dougkeen.bart.R;
|
||||||
import com.dougkeen.bart.model.Departure;
|
import com.dougkeen.bart.model.Departure;
|
||||||
|
|
||||||
public class TrainAlarmDialogFragment extends DialogFragment {
|
public class TrainAlarmDialogFragment extends DialogFragment {
|
||||||
|
|
||||||
|
public static final String TAG = "TRAIN_ALARM_DIALOG_FRAGMENT_TAG";
|
||||||
private static final String KEY_LAST_ALARM_LEAD_TIME = "lastAlarmLeadTime";
|
private static final String KEY_LAST_ALARM_LEAD_TIME = "lastAlarmLeadTime";
|
||||||
|
|
||||||
public TrainAlarmDialogFragment() {
|
public TrainAlarmDialogFragment() {
|
||||||
@ -52,33 +54,35 @@ public class TrainAlarmDialogFragment extends DialogFragment {
|
|||||||
final Departure boardedDeparture = application.getBoardedDeparture();
|
final Departure boardedDeparture = application.getBoardedDeparture();
|
||||||
final int maxValue = boardedDeparture.getMeanSecondsLeft() / 60;
|
final int maxValue = boardedDeparture.getMeanSecondsLeft() / 60;
|
||||||
|
|
||||||
String[] displayedValues = new String[maxValue];
|
numberPicker.setMin(1);
|
||||||
for (int i = 1; i <= maxValue; i++) {
|
numberPicker.setMax(maxValue);
|
||||||
displayedValues[i - 1] = String.valueOf(i);
|
|
||||||
}
|
|
||||||
numberPicker.setMinValue(1);
|
|
||||||
numberPicker.setMaxValue(maxValue);
|
|
||||||
numberPicker.setDisplayedValues(displayedValues);
|
|
||||||
|
|
||||||
if (boardedDeparture.isAlarmPending()) {
|
if (boardedDeparture.isAlarmPending()) {
|
||||||
numberPicker.setValue(boardedDeparture.getAlarmLeadTimeMinutes());
|
setNumber(numberPicker, boardedDeparture.getAlarmLeadTimeMinutes());
|
||||||
} else if (maxValue >= lastAlarmLeadTime) {
|
} else if (maxValue >= lastAlarmLeadTime) {
|
||||||
numberPicker.setValue(lastAlarmLeadTime);
|
setNumber(numberPicker, lastAlarmLeadTime);
|
||||||
} else if (maxValue >= 5) {
|
} else if (maxValue >= 5) {
|
||||||
numberPicker.setValue(5);
|
setNumber(numberPicker, 5);
|
||||||
} else if (maxValue >= 3) {
|
} else if (maxValue >= 3) {
|
||||||
numberPicker.setValue(3);
|
setNumber(numberPicker, 3);
|
||||||
} else {
|
} else {
|
||||||
numberPicker.setValue(1);
|
setNumber(numberPicker, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setNumber(NumberPicker numberPicker, int value) {
|
||||||
|
// Passing in null for the decimalPart and sign doesn't change them.
|
||||||
|
numberPicker.setNumber(value, null /* decimalPart */, null /* sign */);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||||
final FragmentActivity activity = getActivity();
|
final FragmentActivity activity = getActivity();
|
||||||
|
|
||||||
final View dialogView = LayoutInflater.inflate(activity,
|
@SuppressLint("InflateParams")
|
||||||
R.layout.train_alarm_dialog);
|
final View dialogView = LayoutInflater.from(activity)
|
||||||
|
.inflate(R.layout.train_alarm_dialog, null /* root */);
|
||||||
|
|
||||||
return new AlertDialog.Builder(activity)
|
return new AlertDialog.Builder(activity)
|
||||||
.setTitle(R.string.set_up_departure_alarm)
|
.setTitle(R.string.set_up_departure_alarm)
|
||||||
@ -91,8 +95,7 @@ public class TrainAlarmDialogFragment extends DialogFragment {
|
|||||||
int which) {
|
int which) {
|
||||||
NumberPicker numberPicker = (NumberPicker) getDialog()
|
NumberPicker numberPicker = (NumberPicker) getDialog()
|
||||||
.findViewById(R.id.numberPicker);
|
.findViewById(R.id.numberPicker);
|
||||||
final int alarmLeadTime = numberPicker
|
final int alarmLeadTime = numberPicker.getNumber();
|
||||||
.getValue();
|
|
||||||
|
|
||||||
// Save most recent selection
|
// Save most recent selection
|
||||||
Editor editor = getActivity().getPreferences(
|
Editor editor = getActivity().getPreferences(
|
||||||
|
@ -2,12 +2,6 @@ package com.dougkeen.bart.activities;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.holoeverywhere.app.Activity;
|
|
||||||
import org.holoeverywhere.widget.ListView;
|
|
||||||
import org.holoeverywhere.widget.ProgressBar;
|
|
||||||
import org.holoeverywhere.widget.TextView;
|
|
||||||
import org.holoeverywhere.widget.Toast;
|
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.AlertDialog.Builder;
|
import android.app.AlertDialog.Builder;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
@ -23,18 +17,23 @@ import android.os.Handler;
|
|||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.os.Vibrator;
|
import android.os.Vibrator;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.support.v7.view.ActionMode;
|
||||||
import android.text.format.DateFormat;
|
import android.text.format.DateFormat;
|
||||||
import android.text.util.Linkify;
|
import android.text.util.Linkify;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuInflater;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.Checkable;
|
import android.widget.Checkable;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.actionbarsherlock.view.ActionMode;
|
|
||||||
import com.actionbarsherlock.view.Menu;
|
|
||||||
import com.actionbarsherlock.view.MenuInflater;
|
|
||||||
import com.actionbarsherlock.view.MenuItem;
|
|
||||||
import com.dougkeen.bart.BartRunnerApplication;
|
import com.dougkeen.bart.BartRunnerApplication;
|
||||||
import com.dougkeen.bart.R;
|
import com.dougkeen.bart.R;
|
||||||
import com.dougkeen.bart.controls.SwipeHelper;
|
import com.dougkeen.bart.controls.SwipeHelper;
|
||||||
@ -52,7 +51,7 @@ import com.dougkeen.bart.services.EtdService_;
|
|||||||
import com.dougkeen.util.Observer;
|
import com.dougkeen.util.Observer;
|
||||||
import com.dougkeen.util.WakeLocker;
|
import com.dougkeen.util.WakeLocker;
|
||||||
|
|
||||||
public class ViewDeparturesActivity extends Activity implements
|
public class ViewDeparturesActivity extends AppCompatActivity implements
|
||||||
EtdServiceListener {
|
EtdServiceListener {
|
||||||
|
|
||||||
private StationPair mStationPair;
|
private StationPair mStationPair;
|
||||||
@ -399,7 +398,7 @@ public class ViewDeparturesActivity extends Activity implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
MenuInflater inflater = getSupportMenuInflater();
|
MenuInflater inflater = getMenuInflater();
|
||||||
inflater.inflate(R.menu.route_menu, menu);
|
inflater.inflate(R.menu.route_menu, menu);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -453,15 +452,10 @@ public class ViewDeparturesActivity extends Activity implements
|
|||||||
&& departure.getStationPair().equals(getStationPair());
|
&& departure.getStationPair().equals(getStationPair());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setBoardedDeparture(Departure selectedDeparture) {
|
|
||||||
setBoardedDeparture(selectedDeparture, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setBoardedDeparture(Departure selectedDeparture,
|
private void setBoardedDeparture(Departure selectedDeparture,
|
||||||
boolean startActionMode) {
|
boolean startActionMode) {
|
||||||
final BartRunnerApplication application = (BartRunnerApplication) getApplication();
|
final BartRunnerApplication application = (BartRunnerApplication) getApplication();
|
||||||
selectedDeparture
|
selectedDeparture.setPassengerDestination(mStationPair.getDestination());
|
||||||
.setPassengerDestination(mStationPair.getDestination());
|
|
||||||
application.setBoardedDeparture(selectedDeparture);
|
application.setBoardedDeparture(selectedDeparture);
|
||||||
refreshBoardedDeparture(true);
|
refreshBoardedDeparture(true);
|
||||||
|
|
||||||
@ -479,7 +473,7 @@ public class ViewDeparturesActivity extends Activity implements
|
|||||||
|
|
||||||
private void startDepartureActionMode() {
|
private void startDepartureActionMode() {
|
||||||
if (mActionMode == null)
|
if (mActionMode == null)
|
||||||
mActionMode = startActionMode(new DepartureActionMode());
|
mActionMode = startSupportActionMode(new DepartureActionMode());
|
||||||
mActionMode.setTitle(mSelectedDeparture.getTrainDestinationName());
|
mActionMode.setTitle(mSelectedDeparture.getTrainDestinationName());
|
||||||
mActionMode.setSubtitle(mSelectedDeparture.getTrainLengthAndPlatform());
|
mActionMode.setSubtitle(mSelectedDeparture.getTrainLengthAndPlatform());
|
||||||
}
|
}
|
||||||
@ -519,7 +513,7 @@ public class ViewDeparturesActivity extends Activity implements
|
|||||||
|
|
||||||
private void startYourTrainActionMode() {
|
private void startYourTrainActionMode() {
|
||||||
if (mActionMode == null)
|
if (mActionMode == null)
|
||||||
mActionMode = startActionMode(new YourTrainActionMode());
|
mActionMode = startSupportActionMode(new YourTrainActionMode());
|
||||||
mActionMode.setTitle(R.string.your_train);
|
mActionMode.setTitle(R.string.your_train);
|
||||||
Departure boardedDeparture = getBoardedDeparture();
|
Departure boardedDeparture = getBoardedDeparture();
|
||||||
if (boardedDeparture != null && boardedDeparture.isAlarmPending()) {
|
if (boardedDeparture != null && boardedDeparture.isAlarmPending()) {
|
||||||
@ -624,8 +618,7 @@ public class ViewDeparturesActivity extends Activity implements
|
|||||||
// Don't prompt for alarm if train is about to leave
|
// Don't prompt for alarm if train is about to leave
|
||||||
if (boardedDeparture.getMeanSecondsLeft() > 60) {
|
if (boardedDeparture.getMeanSecondsLeft() > 60) {
|
||||||
new TrainAlarmDialogFragment()
|
new TrainAlarmDialogFragment()
|
||||||
.show(getSupportFragmentManager()
|
.show(getSupportFragmentManager(), TrainAlarmDialogFragment.TAG);
|
||||||
.beginTransaction());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -733,7 +726,6 @@ public class ViewDeparturesActivity extends Activity implements
|
|||||||
existingDeparture.mergeEstimate(departure);
|
existingDeparture.mergeEstimate(departure);
|
||||||
} else {
|
} else {
|
||||||
mDeparturesAdapter.add(departure);
|
mDeparturesAdapter.add(departure);
|
||||||
existingDeparture = departure;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -762,6 +754,7 @@ public class ViewDeparturesActivity extends Activity implements
|
|||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
// TODO(fuegofro) - see if there's a way to not use toasts
|
||||||
Toast.makeText(ViewDeparturesActivity.this, errorMessage,
|
Toast.makeText(ViewDeparturesActivity.this, errorMessage,
|
||||||
Toast.LENGTH_LONG).show();
|
Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,15 @@
|
|||||||
package com.dougkeen.bart.activities;
|
package com.dougkeen.bart.activities;
|
||||||
|
|
||||||
import org.holoeverywhere.app.Activity;
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuInflater;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
|
|
||||||
import com.actionbarsherlock.view.Menu;
|
|
||||||
import com.actionbarsherlock.view.MenuInflater;
|
|
||||||
import com.actionbarsherlock.view.MenuItem;
|
|
||||||
import com.dougkeen.bart.R;
|
import com.dougkeen.bart.R;
|
||||||
|
|
||||||
public class ViewMapActivity extends Activity {
|
public class ViewMapActivity extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@ -30,7 +29,7 @@ public class ViewMapActivity extends Activity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
MenuInflater inflater = getSupportMenuInflater();
|
MenuInflater inflater = getMenuInflater();
|
||||||
inflater.inflate(R.menu.system_map_menu, menu);
|
inflater.inflate(R.menu.system_map_menu, menu);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
package com.dougkeen.bart.controls;
|
package com.dougkeen.bart.controls;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.res.TypedArray;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.dougkeen.bart.R;
|
||||||
import com.dougkeen.bart.model.TextProvider;
|
import com.dougkeen.bart.model.TextProvider;
|
||||||
|
|
||||||
public class CountdownTextView extends TextView implements
|
public class CountdownTextView extends TextView implements
|
||||||
@ -27,9 +29,9 @@ public class CountdownTextView extends TextView implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setInstanceVarsFromAttrs(AttributeSet attrs) {
|
private void setInstanceVarsFromAttrs(AttributeSet attrs) {
|
||||||
int tickInterval = attrs.getAttributeIntValue(
|
TypedArray typedArray = getContext().getTheme()
|
||||||
"http://schemas.android.com/apk/res/com.dougkeen.bart",
|
.obtainStyledAttributes(attrs, R.styleable.CountdownTextView, 0, 0);
|
||||||
"tickInterval", 0);
|
int tickInterval = typedArray.getInteger(R.styleable.CountdownTextView_tickInterval, 0);
|
||||||
if (tickInterval > 0) {
|
if (tickInterval > 0) {
|
||||||
setTickInterval(tickInterval);
|
setTickInterval(tickInterval);
|
||||||
}
|
}
|
||||||
|
@ -269,14 +269,14 @@ public class SwipeHelper implements View.OnTouchListener {
|
|||||||
|
|
||||||
public void showWithAnimation() {
|
public void showWithAnimation() {
|
||||||
final int measureSpec = MeasureSpec.makeMeasureSpec(
|
final int measureSpec = MeasureSpec.makeMeasureSpec(
|
||||||
ViewGroup.LayoutParams.WRAP_CONTENT, MeasureSpec.EXACTLY);
|
ViewGroup.LayoutParams.WRAP_CONTENT, MeasureSpec.UNSPECIFIED);
|
||||||
mView.measure(measureSpec, measureSpec);
|
mView.measure(measureSpec, measureSpec);
|
||||||
mViewWidth = mView.getMeasuredWidth();
|
mViewWidth = mView.getMeasuredWidth();
|
||||||
final int viewHeight = mView.getMeasuredHeight();
|
final int viewHeight = mView.getMeasuredHeight();
|
||||||
setAlpha(mView, 0f);
|
setAlpha(mView, 0f);
|
||||||
|
|
||||||
final ViewGroup.LayoutParams lp = mView.getLayoutParams();
|
final ViewGroup.LayoutParams lp = mView.getLayoutParams();
|
||||||
lp.width = mViewWidth;
|
final int originalHeight = lp.height;
|
||||||
|
|
||||||
setTranslationX(mView, mViewWidth);
|
setTranslationX(mView, mViewWidth);
|
||||||
|
|
||||||
@ -288,11 +288,13 @@ public class SwipeHelper implements View.OnTouchListener {
|
|||||||
@Override
|
@Override
|
||||||
public void onAnimationEnd(Animator animation) {
|
public void onAnimationEnd(Animator animation) {
|
||||||
// Reset view presentation
|
// Reset view presentation
|
||||||
// mView.requestLayout();
|
lp.height = originalHeight;
|
||||||
|
mView.setLayoutParams(lp);
|
||||||
|
|
||||||
// Swipe view into space that opened up
|
// Swipe view into space that opened up
|
||||||
animate(mView).translationX(0).alpha(1)
|
animate(mView).translationX(0).alpha(1)
|
||||||
.setDuration(mAnimationTime)
|
.setDuration(mAnimationTime)
|
||||||
|
// Dummy listener so the default doesn't run
|
||||||
.setListener(new AnimatorListenerAdapter() {
|
.setListener(new AnimatorListenerAdapter() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -3,9 +3,11 @@ package com.dougkeen.bart.controls;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.res.TypedArray;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.widget.TextSwitcher;
|
import android.widget.TextSwitcher;
|
||||||
|
|
||||||
|
import com.dougkeen.bart.R;
|
||||||
import com.dougkeen.bart.model.TextProvider;
|
import com.dougkeen.bart.model.TextProvider;
|
||||||
|
|
||||||
public class TimedTextSwitcher extends TextSwitcher implements
|
public class TimedTextSwitcher extends TextSwitcher implements
|
||||||
@ -21,9 +23,9 @@ public class TimedTextSwitcher extends TextSwitcher implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setInstanceVarsFromAttrs(AttributeSet attrs) {
|
private void setInstanceVarsFromAttrs(AttributeSet attrs) {
|
||||||
int tickInterval = attrs.getAttributeIntValue(
|
TypedArray typedArray = getContext().getTheme()
|
||||||
"http://schemas.android.com/apk/res/com.dougkeen.bart",
|
.obtainStyledAttributes(attrs, R.styleable.TimedTextSwitcher, 0, 0);
|
||||||
"tickInterval", 0);
|
int tickInterval = typedArray.getInteger(R.styleable.TimedTextSwitcher_tickInterval, 0);
|
||||||
if (tickInterval > 0) {
|
if (tickInterval > 0) {
|
||||||
setTickInterval(tickInterval);
|
setTickInterval(tickInterval);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
<merge
|
||||||
xmlns:bart="http://schemas.android.com/apk/res/com.dougkeen.bart"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:bart="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent">
|
android:layout_height="fill_parent">
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
<merge
|
||||||
xmlns:bart="http://schemas.android.com/apk/res/com.dougkeen.bart"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:bart="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent">
|
android:layout_height="fill_parent">
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout
|
||||||
xmlns:bart="http://schemas.android.com/apk/res/com.dougkeen.bart"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
@ -20,7 +20,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:padding="10dp"
|
android:padding="10dp"
|
||||||
android:visibility="gone"></com.dougkeen.bart.controls.YourTrainLayout>
|
android:visibility="gone"
|
||||||
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@android:id/empty"
|
android:id="@android:id/empty"
|
||||||
@ -36,7 +37,7 @@
|
|||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@android:id/progress"
|
android:id="@android:id/progress"
|
||||||
style="@style/Holo.ProgressBar.Horizontal"
|
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout
|
||||||
xmlns:bart="http://schemas.android.com/apk/res/com.dougkeen.bart"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:bart="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:paddingLeft="5dp"
|
android:paddingLeft="5dp"
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout
|
||||||
xmlns:app="http://schemas.android.com/apk/res/com.dougkeen.bart"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout
|
||||||
xmlns:holo="http://schemas.android.com/apk/res-auto"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="300dp"
|
android:layout_width="300dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
@ -22,7 +22,7 @@
|
|||||||
android:paddingLeft="5dp"
|
android:paddingLeft="5dp"
|
||||||
android:paddingRight="5dp"
|
android:paddingRight="5dp"
|
||||||
android:paddingTop="15dip"
|
android:paddingTop="15dip"
|
||||||
holo:spinnerMode="dialog" />
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/origin_label"
|
android:id="@+id/origin_label"
|
||||||
@ -48,7 +48,7 @@
|
|||||||
android:paddingLeft="5dp"
|
android:paddingLeft="5dp"
|
||||||
android:paddingRight="5dp"
|
android:paddingRight="5dp"
|
||||||
android:paddingTop="15dip"
|
android:paddingTop="15dip"
|
||||||
holo:spinnerMode="dialog" />
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/destination_label"
|
android:id="@+id/destination_label"
|
||||||
|
@ -1,15 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout
|
||||||
xmlns:holo="http://schemas.android.com/apk/res-auto"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="horizontal">
|
android:orientation="vertical"
|
||||||
|
>
|
||||||
<NumberPicker
|
|
||||||
android:id="@+id/numberPicker"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"></NumberPicker>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView1"
|
android:id="@+id/textView1"
|
||||||
@ -20,6 +15,14 @@
|
|||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:maxLines="3"
|
android:maxLines="3"
|
||||||
android:singleLine="false"
|
android:singleLine="false"
|
||||||
android:text="minutes before departure" />
|
android:text="minutes before departure"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<com.codetroopers.betterpickers.numberpicker.NumberPicker
|
||||||
|
android:id="@+id/numberPicker"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
<merge
|
||||||
xmlns:bart="http://schemas.android.com/apk/res/com.dougkeen.bart">
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:bart="http://schemas.android.com/apk/res-auto" >
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/alarmText"
|
android:id="@+id/alarmText"
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
<menu
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/boardTrain"
|
android:id="@+id/boardTrain"
|
||||||
android:icon="@drawable/ic_action_boarding"
|
android:icon="@drawable/ic_action_boarding"
|
||||||
android:showAsAction="ifRoom|withText"
|
android:title="@string/getting_on_this_train"
|
||||||
android:title="@string/getting_on_this_train"></item>
|
app:showAsAction="ifRoom|withText"
|
||||||
|
/>
|
||||||
</menu>
|
</menu>
|
@ -1,15 +1,20 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
<menu
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/view"
|
android:id="@+id/view"
|
||||||
android:icon="@drawable/ic_action_departure"
|
android:icon="@drawable/ic_action_departure"
|
||||||
android:showAsAction="ifRoom|withText"
|
android:title="@string/view_departures"
|
||||||
android:title="@string/view_departures"></item>
|
app:showAsAction="ifRoom|withText"
|
||||||
|
/>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/delete"
|
android:id="@+id/delete"
|
||||||
android:icon="@drawable/ic_action_delete"
|
android:icon="@drawable/ic_action_delete"
|
||||||
android:showAsAction="ifRoom|withText"
|
android:title="@string/delete"
|
||||||
android:title="@string/delete"></item>
|
app:showAsAction="ifRoom|withText"
|
||||||
|
/>
|
||||||
|
|
||||||
</menu>
|
</menu>
|
@ -1,15 +1,20 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
<menu
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/view_on_bart_site_button"
|
android:id="@+id/view_on_bart_site_button"
|
||||||
android:icon="@drawable/ic_action_web"
|
android:icon="@drawable/ic_action_web"
|
||||||
android:showAsAction="never"
|
android:title="@string/view_on_bart_site"
|
||||||
android:title="@string/view_on_bart_site"></item>
|
app:showAsAction="never"
|
||||||
|
/>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/view_system_map_button"
|
android:id="@+id/view_system_map_button"
|
||||||
android:icon="@drawable/ic_action_map"
|
android:icon="@drawable/ic_action_map"
|
||||||
android:showAsAction="ifRoom|withText"
|
android:title="@string/view_system_map"
|
||||||
android:title="@string/view_system_map"></item>
|
app:showAsAction="ifRoom|withText"
|
||||||
|
/>
|
||||||
|
|
||||||
</menu>
|
</menu>
|
@ -1,20 +1,26 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
<menu
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/add_favorite_menu_button"
|
android:id="@+id/add_favorite_menu_button"
|
||||||
android:icon="@drawable/ic_action_new"
|
android:icon="@drawable/ic_action_new"
|
||||||
android:showAsAction="ifRoom|withText"
|
android:title="@string/add_route"
|
||||||
android:title="@string/add_route"></item>
|
app:showAsAction="ifRoom|withText"
|
||||||
|
/>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/view_system_map_button"
|
android:id="@+id/view_system_map_button"
|
||||||
android:icon="@drawable/ic_action_map"
|
android:icon="@drawable/ic_action_map"
|
||||||
android:showAsAction="ifRoom|withText"
|
android:title="@string/view_system_map"
|
||||||
android:title="@string/view_system_map"></item>
|
app:showAsAction="ifRoom|withText"
|
||||||
|
/>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/elevator_button"
|
android:id="@+id/elevator_button"
|
||||||
android:icon="@drawable/ic_action_elevator"
|
android:icon="@drawable/ic_action_elevator"
|
||||||
android:showAsAction="ifRoom|withText"
|
android:title="Check elevator status"
|
||||||
android:title="Check elevator status"></item>
|
app:showAsAction="ifRoom|withText"
|
||||||
|
/>
|
||||||
|
|
||||||
</menu>
|
</menu>
|
@ -1,26 +1,33 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
<menu
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/cancel_alarm_button"
|
android:id="@+id/cancel_alarm_button"
|
||||||
android:icon="@drawable/ic_action_cancel_alarm"
|
android:icon="@drawable/ic_action_cancel_alarm"
|
||||||
android:showAsAction="always|withText"
|
|
||||||
android:title="@string/cancel_alarm"
|
android:title="@string/cancel_alarm"
|
||||||
android:visible="false" />
|
android:visible="false"
|
||||||
|
app:showAsAction="always|withText"
|
||||||
|
/>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/set_alarm_button"
|
android:id="@+id/set_alarm_button"
|
||||||
android:icon="@drawable/ic_action_alarm"
|
android:icon="@drawable/ic_action_alarm"
|
||||||
android:showAsAction="always|withText"
|
android:title="@string/set_alarm"
|
||||||
android:title="@string/set_alarm" />
|
app:showAsAction="always|withText"
|
||||||
|
/>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/share_arrival"
|
android:id="@+id/share_arrival"
|
||||||
android:icon="@drawable/ic_action_mail"
|
android:icon="@drawable/ic_action_mail"
|
||||||
android:showAsAction="always|withText"
|
android:title="@string/share_arrival_time"
|
||||||
android:title="@string/share_arrival_time" />
|
app:showAsAction="always|withText"
|
||||||
|
/>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/delete"
|
android:id="@+id/delete"
|
||||||
android:icon="@drawable/ic_action_delete"
|
android:icon="@drawable/ic_action_delete"
|
||||||
android:showAsAction="always|withText"
|
android:title="@string/delete"
|
||||||
android:title="@string/delete"></item>
|
app:showAsAction="always|withText"
|
||||||
|
/>
|
||||||
|
|
||||||
</menu>
|
</menu>
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<!-- Base application theme is the default theme. -->
|
<!-- Base application theme is the default theme. -->
|
||||||
|
|
||||||
<style name="AppTheme" parent="@style/Holo.Theme"></style>
|
<style name="AppTheme" parent="Theme.AppCompat"></style>
|
||||||
|
|
||||||
<style name="ButtonBar">
|
<style name="ButtonBar">
|
||||||
<item name="android:layout_width">fill_parent</item>
|
<item name="android:layout_width">fill_parent</item>
|
||||||
|
@ -4,15 +4,15 @@ apply plugin: 'com.android.library'
|
|||||||
// so we can control how it builds without having to submit pull requests.
|
// so we can control how it builds without having to submit pull requests.
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.android.support:support-v4:19.1.0'
|
compile 'com.android.support:support-v4:22.2.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 7
|
compileSdkVersion 22
|
||||||
buildToolsVersion "22.0.1"
|
buildToolsVersion "22.0.1"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
targetSdkVersion 7
|
targetSdkVersion 22
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 57b0ecd306cf50d44af779a58f09761e65f3b3bd
|
|
@ -1,27 +0,0 @@
|
|||||||
apply plugin: 'com.android.library'
|
|
||||||
|
|
||||||
// This file is here (rather than in the holoeverywhere project)
|
|
||||||
// so we can control how it builds without having to submit pull requests.
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compile 'com.android.support:support-v4:13.0.0'
|
|
||||||
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
|
|
||||||
}
|
|
||||||
|
|
||||||
android {
|
|
||||||
compileSdkVersion 17
|
|
||||||
buildToolsVersion "22.0.1"
|
|
||||||
|
|
||||||
defaultConfig {
|
|
||||||
targetSdkVersion 17
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
main {
|
|
||||||
manifest.srcFile '../holoeverywhere/library/AndroidManifest.xml'
|
|
||||||
java.srcDirs = ['../holoeverywhere/library/src']
|
|
||||||
res.srcDirs = ['../holoeverywhere/library/res']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
|||||||
apply plugin: 'com.android.library'
|
|
||||||
|
|
||||||
// This file is here (rather than in the holoeverywhere project)
|
|
||||||
// so we can control how it builds without having to submit pull requests.
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compile project(':holoeverywhere-gradle')
|
|
||||||
}
|
|
||||||
|
|
||||||
android {
|
|
||||||
compileSdkVersion 17
|
|
||||||
buildToolsVersion '22.0.1'
|
|
||||||
|
|
||||||
defaultConfig {
|
|
||||||
targetSdkVersion 17
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
main {
|
|
||||||
manifest.srcFile '../holoeverywhere/addons/preferences/AndroidManifest.xml'
|
|
||||||
java.srcDirs = ['../holoeverywhere/addons/preferences/src']
|
|
||||||
res.srcDirs = ['../holoeverywhere/addons/preferences/res']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 9f20fd77e04942fd50b95aeb1c492a38e36c06dd
|
|
@ -1,4 +1,2 @@
|
|||||||
include ':app'
|
include ':app'
|
||||||
include ":holoeverywhere-gradle"
|
|
||||||
include ":holoeverywhere-preferences-gradle"
|
|
||||||
include ":drag-sort-listview-gradle"
|
include ":drag-sort-listview-gradle"
|
||||||
|
Loading…
Reference in New Issue
Block a user