increased touch target for GPX export button + smaller bug fixes.
This commit is contained in:
		
							parent
							
								
									4b2ad8d140
								
							
						
					
					
						commit
						7f3979d4f4
					
				
					 9 changed files with 58 additions and 34 deletions
				
			
		|  | @ -2,14 +2,14 @@ apply plugin: 'com.android.application' | |||
| 
 | ||||
| android { | ||||
|     compileSdkVersion 25 | ||||
|     buildToolsVersion '25.0.0' | ||||
|     buildToolsVersion '25.0.3' | ||||
| 
 | ||||
|     defaultConfig { | ||||
|         applicationId "org.y20k.trackbook" | ||||
|         minSdkVersion 22 | ||||
|         targetSdkVersion 25 | ||||
|         versionCode 8 | ||||
|         versionName "1.0.1 (Astronomy Domine)" | ||||
|         versionCode 9 | ||||
|         versionName "1.0.2 (Astronomy Domine)" | ||||
|         vectorDrawables.useSupportLibrary = true | ||||
|     } | ||||
|     buildTypes { | ||||
|  | @ -22,9 +22,9 @@ android { | |||
| 
 | ||||
| dependencies { | ||||
|     compile fileTree(include: ['*.jar'], dir: 'libs') | ||||
|     compile 'com.android.support:appcompat-v7:25.2.0' | ||||
|     compile 'com.android.support:design:25.2.0' | ||||
|     compile 'com.android.support:cardview-v7:25.2.0' | ||||
|     compile 'com.android.support:appcompat-v7:25.3.1' | ||||
|     compile 'com.android.support:design:25.3.1' | ||||
|     compile 'com.android.support:cardview-v7:25.3.1' | ||||
|     compile 'org.osmdroid:osmdroid-android:5.6.4' | ||||
|     compile 'com.google.code.gson:gson:2.8.0' | ||||
| } | ||||
|  |  | |||
|  | @ -124,6 +124,9 @@ public class MainActivityTrackFragment extends Fragment implements AdapterView.O | |||
|                     mDropdownAdapter.notifyDataSetChanged(); | ||||
|                     mDropdown.setAdapter(mDropdownAdapter); | ||||
|                     mDropdown.setSelection(0, true); | ||||
| 
 | ||||
|                     // remove onboarding if necessary | ||||
|                     switchOnboardingLayout(); | ||||
|                 } | ||||
|             } | ||||
|         }; | ||||
|  | @ -295,7 +298,6 @@ public class MainActivityTrackFragment extends Fragment implements AdapterView.O | |||
|     } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|     @Override | ||||
|     public void onActivityResult(int requestCode, int resultCode, Intent data) { | ||||
|         super.onActivityResult(requestCode, resultCode, data); | ||||
|  | @ -321,8 +323,6 @@ public class MainActivityTrackFragment extends Fragment implements AdapterView.O | |||
|     } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|     /* Displays map and statistics for track */ | ||||
|     private void displayTrack() { | ||||
|         GeoPoint position; | ||||
|  | @ -428,9 +428,11 @@ public class MainActivityTrackFragment extends Fragment implements AdapterView.O | |||
|             public void onClick(View view) { | ||||
|                 // get text elements for delete dialog | ||||
|                 int dialogTitle = R.string.dialog_delete_title; | ||||
|                 String dialogMessage = getString(R.string.dialog_delete_content) + " " + mTrack.getTrackDuration() + " | " + mTrack.getTrackDistance(); | ||||
|                 int dialogPositiveButton = R.string.dialog_delete_action_delete; | ||||
|                 int dialogNegativeButton = R.string.dialog_default_action_cancel; | ||||
|                 DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.getDefault()); | ||||
|                 String recordingStartDate = df.format(mTrack.getRecordingStart()); | ||||
|                 String dialogMessage = getString(R.string.dialog_delete_content) + " " + recordingStartDate + " | " + mTrack.getTrackDistance(); | ||||
| 
 | ||||
|                 // show delete dialog - results are handles by onActivityResult | ||||
|                 DialogFragment dialogFragment = DialogHelper.newInstance(dialogTitle, dialogMessage, dialogPositiveButton, dialogNegativeButton); | ||||
|  | @ -448,9 +450,11 @@ public class MainActivityTrackFragment extends Fragment implements AdapterView.O | |||
|             public void onClick(View view) { | ||||
|                 // dialog text components | ||||
|                 int dialogTitle; | ||||
|                 String dialogMessage; | ||||
|                 int dialogPositiveButton; | ||||
|                 int dialogNegativeButton; | ||||
|                 DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.getDefault()); | ||||
|                 String recordingStartDate = df.format(mTrack.getRecordingStart()); | ||||
|                 String dialogMessage; | ||||
| 
 | ||||
|                 // create an ExportHelper | ||||
|                 final ExportHelper exportHelper = new ExportHelper(mActivity); | ||||
|  | @ -459,7 +463,7 @@ public class MainActivityTrackFragment extends Fragment implements AdapterView.O | |||
|                 if (exportHelper.gpxFileExists(mTrack)) { | ||||
|                     // CASE: OVERWRITE - GPX file exists | ||||
|                     dialogTitle = R.string.dialog_export_title_overwrite; | ||||
|                     dialogMessage = getString(R.string.dialog_export_content_overwrite) + " (" + mTrack.getTrackDuration() + " | " + mTrack.getTrackDistance() + ")"; | ||||
|                     dialogMessage = getString(R.string.dialog_export_content_overwrite) + " (" + recordingStartDate + " | " + mTrack.getTrackDistance() + ")"; | ||||
|                     dialogPositiveButton = R.string.dialog_export_action_overwrite; | ||||
|                     dialogNegativeButton = R.string.dialog_default_action_cancel; | ||||
|                 } else { | ||||
|  |  | |||
|  | @ -76,9 +76,10 @@ public class TrackerService extends Service implements TrackbookKeys, SensorEven | |||
| 
 | ||||
| 
 | ||||
|     @Override | ||||
|     public int onStartCommand(Intent intent, int flags, int startId) { | ||||
|     public void onCreate() { | ||||
|         super.onCreate(); | ||||
| 
 | ||||
|         // listen for finished save operation | ||||
|         // receiver: listen track request issued by the main map - in onResume | ||||
|         mTrackRequestReceiver = new BroadcastReceiver() { | ||||
|             @Override | ||||
|             public void onReceive(Context context, Intent intent) { | ||||
|  | @ -98,11 +99,17 @@ public class TrackerService extends Service implements TrackbookKeys, SensorEven | |||
|         mLocationSystemSetting = LocationHelper.checkLocationSystemSetting(getApplicationContext()); | ||||
| 
 | ||||
|         // create content observer for changes in System Settings | ||||
|         mSettingsContentObserver = new SettingsContentObserver( new Handler()); | ||||
|         mSettingsContentObserver = new SettingsContentObserver(new Handler()); | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     @Override | ||||
|     public int onStartCommand(Intent intent, int flags, int startId) { | ||||
| 
 | ||||
|         // check if user did turn off location in device settings | ||||
|         if (!mLocationSystemSetting) { | ||||
|             LogHelper.v(LOG_TAG, "Location Setting is turned off."); | ||||
|             LogHelper.i(LOG_TAG, "Location Setting is turned off."); | ||||
|             Toast.makeText(getApplicationContext(), R.string.toast_message_location_offline, Toast.LENGTH_LONG).show(); | ||||
|             stopTracking(); | ||||
|             return START_STICKY; | ||||
|  | @ -110,7 +117,8 @@ public class TrackerService extends Service implements TrackbookKeys, SensorEven | |||
| 
 | ||||
|         // checking for empty intent | ||||
|         if (intent == null) { | ||||
|             LogHelper.v(LOG_TAG, "Null-Intent received. Stopping self."); | ||||
|             LogHelper.e(LOG_TAG, "Null-Intent received. Stopping self."); | ||||
|             // stopSelf triggers onDestroy | ||||
|             stopSelf(); | ||||
|         } | ||||
| 
 | ||||
|  | @ -225,7 +233,7 @@ public class TrackerService extends Service implements TrackbookKeys, SensorEven | |||
|         if (stepCounter != null) { | ||||
|             mSensorManager.registerListener(this, stepCounter, SensorManager.SENSOR_DELAY_UI); | ||||
|         } else { | ||||
|             LogHelper.v(LOG_TAG, "Pedometer Sensor not available"); | ||||
|             LogHelper.i(LOG_TAG, "Pedometer Sensor not available"); | ||||
|             mTrack.setStepCount(-1); | ||||
|         } | ||||
| 
 | ||||
|  | @ -313,11 +321,13 @@ public class TrackerService extends Service implements TrackbookKeys, SensorEven | |||
| 
 | ||||
|     /* Broadcasts a track update */ | ||||
|     private void sendTrackUpdate() { | ||||
|         Intent i = new Intent(); | ||||
|         i.setAction(ACTION_TRACK_UPDATED); | ||||
|         i.putExtra(EXTRA_TRACK, mTrack); | ||||
|         i.putExtra(EXTRA_LAST_LOCATION, mCurrentBestLocation); | ||||
|         LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(i); | ||||
|         if (mTrack != null) { | ||||
|             Intent i = new Intent(); | ||||
|             i.setAction(ACTION_TRACK_UPDATED); | ||||
|             i.putExtra(EXTRA_TRACK, mTrack); | ||||
|             i.putExtra(EXTRA_LAST_LOCATION, mCurrentBestLocation); | ||||
|             LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(i); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
|  | @ -59,7 +59,7 @@ public class DialogHelper extends DialogFragment implements TrackbookKeys { | |||
|         if (title != -1) { | ||||
|             dialogBuilder.setTitle(title); | ||||
|         } | ||||
|         dialogBuilder.setTitle(message); | ||||
|         dialogBuilder.setMessage(message); | ||||
|         dialogBuilder.setPositiveButton(positiveButton, | ||||
|                 new DialogInterface.OnClickListener() { | ||||
|                     public void onClick(DialogInterface dialog, int whichButton) { | ||||
|  |  | |||
|  | @ -26,7 +26,7 @@ import android.util.Log; | |||
|  */ | ||||
| public final class LogHelper { | ||||
| 
 | ||||
|     private final static boolean mTesting = true; | ||||
|     private final static boolean mTesting = false; | ||||
| 
 | ||||
|     public static void d(final String tag, String message) { | ||||
|         // include logging only in debug versions | ||||
|  |  | |||
|  | @ -44,9 +44,12 @@ | |||
|                 android:layout_width="wrap_content" | ||||
|                 android:layout_height="wrap_content" | ||||
|                 android:layout_gravity="end|center" | ||||
|                 android:layout_marginStart="@dimen/activity_horizontal_margin" | ||||
|                 android:layout_marginEnd="@dimen/activity_horizontal_margin" | ||||
|                 android:background="@drawable/ic_export_white_24dp" | ||||
|                 android:paddingStart="@dimen/activity_horizontal_margin" | ||||
|                 android:paddingEnd="@dimen/activity_horizontal_margin" | ||||
|                 android:src="@drawable/ic_export_white_24dp" | ||||
|                 android:background="@android:color/transparent" | ||||
|                 android:paddingTop="8dp" | ||||
|                 android:paddingBottom="8dp" | ||||
|                 android:contentDescription="@string/descr_export_button" /> | ||||
|             <ImageButton | ||||
|                 android:visibility="gone" | ||||
|  | @ -54,9 +57,12 @@ | |||
|                 android:layout_width="wrap_content" | ||||
|                 android:layout_height="wrap_content" | ||||
|                 android:layout_gravity="end|center" | ||||
|                 android:layout_marginStart="@dimen/activity_horizontal_margin" | ||||
|                 android:layout_marginEnd="@dimen/activity_horizontal_margin" | ||||
|                 android:background="@drawable/ic_delete_forever_white_24dp" | ||||
|                 android:paddingStart="@dimen/activity_horizontal_margin" | ||||
|                 android:paddingEnd="@dimen/activity_horizontal_margin" | ||||
|                 android:paddingTop="8dp" | ||||
|                 android:paddingBottom="8dp" | ||||
|                 android:src="@drawable/ic_delete_forever_white_24dp" | ||||
|                 android:background="@android:color/transparent" | ||||
|                 android:contentDescription="@string/descr_delete_button" /> | ||||
|         </LinearLayout> | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| <?xml version='1.0' encoding='UTF-8'?> | ||||
| <resources> | ||||
|     <string name="app_name">Trackbook</string> | ||||
|     <string name="app_name">Trackbook</string> <!-- please do not translate app_name - transcription into different alphabet types is fine though --> | ||||
|     <string name="title_activity_infosheet">情報シート</string> | ||||
| 
 | ||||
|     <string name="menu_my_location">私の場所</string> | ||||
|  |  | |||
|  | @ -1,5 +1,7 @@ | |||
| <?xml version='1.0' encoding='UTF-8'?> | ||||
| <resources><string name="app_name">Sporingsbok</string> <string name="title_activity_infosheet">Infoark</string> | ||||
| <resources> | ||||
|     <string name="app_name">Trackbook</string> <!-- please do not translate app_name - transcription into different alphabet types is fine though --> | ||||
|     <string name="title_activity_infosheet">Infoark</string> | ||||
| 
 | ||||
|     <string name="menu_my_location">Min plasssering</string> | ||||
|     <string name="menu_about">Om</string> | ||||
|  |  | |||
|  | @ -1,5 +1,7 @@ | |||
| <?xml version='1.0' encoding='UTF-8'?> | ||||
| <resources><string name="app_name">Trackbook</string> <string name="title_activity_infosheet">Informatieblad</string> | ||||
| <resources> | ||||
|     <string name="app_name">Trackbook</string> <!-- please do not translate app_name - transcription into different alphabet types is fine though --> | ||||
|     <string name="title_activity_infosheet">Informatieblad</string> | ||||
| 
 | ||||
|     <string name="menu_my_location">Mijn locatie</string> | ||||
|     <string name="menu_about">Over</string> | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 y20k
						y20k