changed the statistics icon to a more space saving one + some clean-up
This commit is contained in:
		
							parent
							
								
									44c7829ec3
								
							
						
					
					
						commit
						179a3f8558
					
				
					 9 changed files with 50 additions and 25 deletions
				
			
		|  | @ -414,6 +414,7 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys { | |||
|                 mFloatingActionButtonSubMenu1.setOnClickListener(new View.OnClickListener() { | ||||
|                     @Override | ||||
|                     public void onClick(View view) { | ||||
|                         // todo check -> may produce NullPointerException | ||||
|                         MainActivityMapFragment mainActivityMapFragment = (MainActivityMapFragment) mSectionsPagerAdapter.getFragment(FRAGMENT_ID_MAP); | ||||
|                         mainActivityMapFragment.onActivityResult(RESULT_SAVE_DIALOG, Activity.RESULT_OK, getIntent()); | ||||
|                         handleStateAfterSave(); | ||||
|  | @ -474,7 +475,7 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys { | |||
|                 mFloatingActionButtonState = FAB_STATE_RECORDING; | ||||
|                 setFloatingActionButtonState(); | ||||
| 
 | ||||
|                 // get last location from MainActivity Fragment | ||||
|                 // get last location from MainActivity Fragment // todo check -> may produce NullPointerException | ||||
|                 MainActivityMapFragment mainActivityMapFragment = (MainActivityMapFragment) mSectionsPagerAdapter.getFragment(FRAGMENT_ID_MAP); | ||||
|                 Location lastLocation = mainActivityMapFragment.getCurrentBestLocation(); | ||||
| 
 | ||||
|  | @ -525,7 +526,7 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys { | |||
| 
 | ||||
|         } | ||||
| 
 | ||||
|         // update tracking state in MainActivityMapFragment | ||||
|         // update tracking state in MainActivityMapFragment // todo check -> may produce NullPointerException | ||||
|         MainActivityMapFragment mainActivityMapFragment = (MainActivityMapFragment) mSectionsPagerAdapter.getFragment(FRAGMENT_ID_MAP); | ||||
|         mainActivityMapFragment.setTrackingState(mTrackerServiceRunning); | ||||
|     } | ||||
|  | @ -660,7 +661,7 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys { | |||
|                 mFloatingActionButtonState = FAB_STATE_SAVE; | ||||
|                 setFloatingActionButtonState(); | ||||
| 
 | ||||
|                 // pass tracking state to MainActivityMapFragment | ||||
|                 // pass tracking state to MainActivityMapFragment // todo check -> may produce NullPointerException | ||||
|                 MainActivityMapFragment mainActivityMapFragment = (MainActivityMapFragment) mSectionsPagerAdapter.getFragment(FRAGMENT_ID_MAP); | ||||
|                 mainActivityMapFragment.setTrackingState(false); | ||||
|             } | ||||
|  |  | |||
|  | @ -36,6 +36,7 @@ import android.view.View; | |||
| import android.view.ViewGroup; | ||||
| import android.widget.AdapterView; | ||||
| import android.widget.ImageButton; | ||||
| import android.widget.ImageView; | ||||
| import android.widget.LinearLayout; | ||||
| import android.widget.Spinner; | ||||
| import android.widget.TextView; | ||||
|  | @ -81,6 +82,8 @@ public class MainActivityTrackFragment extends Fragment implements AdapterView.O | |||
|     private LinearLayout mTrackManagementLayout; | ||||
|     private Spinner mDropdown; | ||||
|     private View mStatisticsSheet; | ||||
|     private ImageView mStatisticsIcon; | ||||
|     private TextView mStatisticsHeadline; | ||||
|     private TextView mDistanceView; | ||||
|     private TextView mStepsView; | ||||
|     private TextView mWaypointsView; | ||||
|  | @ -189,6 +192,8 @@ public class MainActivityTrackFragment extends Fragment implements AdapterView.O | |||
| 
 | ||||
|         // get views for statistics sheet | ||||
|         View statisticsView = mRootView.findViewById(R.id.statistics_view); | ||||
|         mStatisticsIcon = mRootView.findViewById(R.id.statistics_icon); | ||||
|         mStatisticsHeadline = mRootView.findViewById(R.id.statistics_headline); | ||||
|         mStatisticsSheet = mRootView.findViewById(R.id.statistics_sheet); | ||||
|         mDistanceView = (TextView) mRootView.findViewById(R.id.statistics_data_distance); | ||||
|         mStepsView = (TextView) mRootView.findViewById(R.id.statistics_data_steps); | ||||
|  | @ -427,10 +432,16 @@ public class MainActivityTrackFragment extends Fragment implements AdapterView.O | |||
|                     case BottomSheetBehavior.STATE_EXPANDED: | ||||
|                         // statistics sheet expanded | ||||
|                         mTrackManagementLayout.setVisibility(View.INVISIBLE); | ||||
| //                        mStatisticsSheet.setBackgroundColor(ContextCompat.getColor(mActivity, R.color.trackbook_blue_85percent)); | ||||
| //                        mStatisticsIcon.setBackgroundResource(R.drawable.ic_statistics_white_48dp); | ||||
| //                        mStatisticsHeadline.setVisibility(View.VISIBLE); | ||||
|                         break; | ||||
|                     case BottomSheetBehavior.STATE_COLLAPSED: | ||||
|                         // statistics sheet collapsed | ||||
|                         mTrackManagementLayout.setVisibility(View.VISIBLE); | ||||
| //                        mStatisticsSheet.setBackgroundColor(ContextCompat.getColor(mActivity, R.color.trackbook_transparent)); | ||||
| //                        mStatisticsIcon.setBackgroundResource(R.drawable.ic_statistics_blue_48dp); | ||||
| //                        mStatisticsHeadline.setVisibility(View.INVISIBLE); | ||||
|                         mStatisticsSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); | ||||
|                         break; | ||||
|                     case BottomSheetBehavior.STATE_HIDDEN: | ||||
|  | @ -449,7 +460,15 @@ public class MainActivityTrackFragment extends Fragment implements AdapterView.O | |||
|                 } else { | ||||
|                     mTrackManagementLayout.setVisibility(View.INVISIBLE); | ||||
|                 } | ||||
| 
 | ||||
| //                if (slideOffset < 0.125f) { | ||||
| //                    mStatisticsSheet.setBackgroundColor(ContextCompat.getColor(mActivity, R.color.trackbook_transparent)); | ||||
| //                    mStatisticsIcon.setBackgroundResource(R.drawable.ic_statistics_blue_48dp); | ||||
| //                    mStatisticsHeadline.setVisibility(View.INVISIBLE); | ||||
| //                } else { | ||||
| //                    mStatisticsSheet.setBackgroundColor(ContextCompat.getColor(mActivity, R.color.trackbook_blue_85percent)); | ||||
| //                    mStatisticsIcon.setBackgroundResource(R.drawable.ic_statistics_white_48dp); | ||||
| //                    mStatisticsHeadline.setVisibility(View.VISIBLE); | ||||
| //                } | ||||
|             } | ||||
|         }; | ||||
|     } | ||||
|  |  | |||
|  | @ -173,7 +173,7 @@ public class TrackerService extends Service implements TrackbookKeys, SensorEven | |||
| //        stopFindingLocation(); | ||||
| //        mSensorManager.unregisterListener(this); | ||||
| 
 | ||||
|         // todo describe | ||||
|         // remove TrackerService from foreground state | ||||
|         stopForeground(true); | ||||
| 
 | ||||
|         super.onDestroy(); | ||||
|  | @ -297,7 +297,7 @@ public class TrackerService extends Service implements TrackbookKeys, SensorEven | |||
|         // disable content observer for changes in System Settings | ||||
|         this.getContentResolver().unregisterContentObserver(mSettingsContentObserver); | ||||
| 
 | ||||
|         // todo describe | ||||
|         // remove TrackerService from foreground state | ||||
|         stopForeground(false); | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
|  | @ -71,7 +71,7 @@ public class StorageHelper implements TrackbookKeys { | |||
|             mFolder.mkdirs(); | ||||
|         } | ||||
| 
 | ||||
|         // create temp file object | ||||
|         // create temp file object // todo check -> may produce NullPointerException | ||||
|         mTempFile = new File(mFolder.toString() + "/" + FILE_NAME_TEMP + FILE_TYPE_TRACKBOOK_EXTENSION); | ||||
| 
 | ||||
|         // delete old track - exclude temp file | ||||
|  |  | |||
							
								
								
									
										9
									
								
								app/src/main/res/drawable/ic_info_white_24dp.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								app/src/main/res/drawable/ic_info_white_24dp.xml
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,9 @@ | |||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|         android:width="24dp" | ||||
|         android:height="24dp" | ||||
|         android:viewportWidth="24.0" | ||||
|         android:viewportHeight="24.0"> | ||||
|     <path | ||||
|         android:fillColor="@color/trackbook_white" | ||||
|         android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-6h2v6zM13,9h-2L11,7h2v2z"/> | ||||
| </vector> | ||||
|  | @ -1,9 +0,0 @@ | |||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     android:width="48dp" | ||||
|     android:height="48dp" | ||||
|     android:viewportWidth="24.0" | ||||
|     android:viewportHeight="24.0"> | ||||
|     <path | ||||
|         android:fillColor="@color/trackbook_white" | ||||
|         android:pathData="M19,3L5,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM9,17L7,17v-7h2v7zM13,17h-2L11,7h2v10zM17,17h-2v-4h2v4z"/> | ||||
| </vector> | ||||
|  | @ -76,7 +76,7 @@ | |||
|         android:layout_gravity="bottom" | ||||
|         android:background="@color/trackbook_blue_85percent" | ||||
|         app:behavior_hideable="true" | ||||
|         app:behavior_peekHeight="132dp" | ||||
|         app:behavior_peekHeight="112dp" | ||||
|         app:layout_behavior="android.support.design.widget.BottomSheetBehavior"> | ||||
| 
 | ||||
|         <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|  | @ -99,9 +99,10 @@ | |||
|                     android:paddingEnd="@dimen/activity_horizontal_margin" | ||||
|                     android:orientation="horizontal"> | ||||
|                     <TextView | ||||
|                         android:id="@+id/statistics_headline" | ||||
|                         android:layout_width="0dp" | ||||
|                         android:layout_height="match_parent" | ||||
|                         android:textAppearance="@android:style/TextAppearance.Large.Inverse" | ||||
|                         android:textAppearance="@android:style/TextAppearance.Medium.Inverse" | ||||
|                         android:layout_weight="1" | ||||
|                         android:gravity="start|center" | ||||
|                         android:textStyle="bold" | ||||
|  | @ -109,11 +110,12 @@ | |||
|                         android:text="@string/statistics_sheet_h1_statistics" | ||||
|                         android:contentDescription="@string/descr_statistics_sheet_headline" /> | ||||
|                     <ImageView | ||||
|                         android:id="@+id/statistics_icon" | ||||
|                         android:layout_width="wrap_content" | ||||
|                         android:layout_height="wrap_content" | ||||
|                         android:gravity="end|center" | ||||
|                         android:background="@drawable/ic_statistics_white_48dp" | ||||
|                         android:contentDescription="@string/descr_statistics_sheet_icon" /> | ||||
|                         android:contentDescription="@string/descr_statistics_sheet_icon" | ||||
|                         app:srcCompat="@drawable/ic_info_white_24dp" /> | ||||
|                 </LinearLayout> | ||||
| 
 | ||||
|                 <LinearLayout | ||||
|  |  | |||
|  | @ -18,4 +18,7 @@ | |||
|     <color name="trackbook_grey">#FF455a64</color> | ||||
|     <color name="trackbook_grey_85percent">#D9455a64</color> | ||||
| 
 | ||||
|     <color name="trackbook_transparent">#00000000</color> | ||||
| 
 | ||||
| 
 | ||||
| </resources> | ||||
|  |  | |||
							
								
								
									
										10
									
								
								build.gradle
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								build.gradle
									
									
									
									
									
								
							|  | @ -21,16 +21,16 @@ allprojects { | |||
|     } | ||||
|     project.ext { | ||||
|         applicationId = 'org.y20k.trackbook' | ||||
|         versionCode = 14 | ||||
|         versionName = '1.0.7' | ||||
|         versionCode = 15 | ||||
|         versionName = '1.0.8' | ||||
|         minSdkVersion = 22 | ||||
|         compileSdkVersion = 26 | ||||
|         targetSdkVersion = 26 | ||||
|         buildToolsVersion = '26.0.1' | ||||
|         supportLibraryVersion = '26.0.1' | ||||
|         buildToolsVersion = '26.0.2' | ||||
|         supportLibraryVersion = '26.1.0' | ||||
| 
 | ||||
|         osmdroidVersion = '5.6.5' | ||||
|         gsonVersion = '2.8.1' | ||||
|         gsonVersion = '2.8.2' | ||||
|     } | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 y20k
						y20k