diff --git a/Nearby/build.gradle b/Nearby/build.gradle index 97318a6039..10bc755353 100644 --- a/Nearby/build.gradle +++ b/Nearby/build.gradle @@ -6,8 +6,8 @@ android { defaultConfig { applicationId "com.esri.arcgis.android.samples.nearby" - minSdkVersion 15 - targetSdkVersion 21 + minSdkVersion 16 + targetSdkVersion 22 versionCode 1 versionName "1.0" } @@ -28,4 +28,5 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) + compile 'com.android.support:appcompat-v7:22.1.1' } diff --git a/Nearby/src/main/AndroidManifest.xml b/Nearby/src/main/AndroidManifest.xml index a6331cd084..077f6f211b 100644 --- a/Nearby/src/main/AndroidManifest.xml +++ b/Nearby/src/main/AndroidManifest.xml @@ -16,7 +16,8 @@ + android:label="@string/app_name" + android:theme="@style/AppTheme" > mFindOutFields = new ArrayList(); + ArrayList mFindOutFields = new ArrayList<>(); LocationDisplayManager mLDM; - LinearLayout mPlaceLayout; /** @@ -171,8 +170,6 @@ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); - mPlaceLayout = (LinearLayout) findViewById(R.id.placeLayout); - mMapView = (MapView) findViewById(R.id.map); mMapView.setOnStatusChangedListener(statusChangedListener); mMapView.setOnSingleTapListener(mapTapCallback); @@ -192,13 +189,9 @@ public void onCreate(Bundle savedInstanceState) { mResultsLayer.setSelectionColorWidth(6); mMapView.addLayer(mResultsLayer); - - mCoffeeMapIcon = new PictureMarkerSymbol(getApplicationContext(), this - .getResources().getDrawable(R.drawable.ic_local_cafe_black)); - mPizzaMapIcon = new PictureMarkerSymbol(getApplicationContext(), this - .getResources().getDrawable(R.drawable.ic_local_pizza_black)); - mBarMapIcon = new PictureMarkerSymbol(getApplicationContext(), this - .getResources().getDrawable(R.drawable.ic_local_drink_black)); + mCoffeeMapIcon = new PictureMarkerSymbol(getApplicationContext(), ContextCompat.getDrawable(getApplicationContext(), R.drawable.ic_local_cafe_black)); + mPizzaMapIcon = new PictureMarkerSymbol(getApplicationContext(), ContextCompat.getDrawable(getApplicationContext(), R.drawable.ic_local_pizza_black)); + mBarMapIcon = new PictureMarkerSymbol(getApplicationContext(), ContextCompat.getDrawable(getApplicationContext(), R.drawable.ic_local_drink_black)); setupLocator(); setupLocationListener(); @@ -332,8 +325,7 @@ public void onCallback(List results) { } }; - try - { + try { setProgressOnUIThread(true); // Get the current map extent. @@ -356,8 +348,7 @@ public void onCallback(List results) { // Call find, passing in the callback above. mLocator.find(fParams, findCallback); - } - catch (Exception e) { + } catch (Exception e) { // Update UI and report any errors. setProgressOnUIThread(false); @@ -532,8 +523,7 @@ public void updateContent(Map attributes) { String phone = attributes.get(getResources().getString( R.string.result_phone)).toString(); mPhoneTextView.setText(phone); - mPhoneImageView.setImageDrawable(getResources().getDrawable( - R.drawable.ic_action_call)); + mPhoneImageView.setImageDrawable(ContextCompat.getDrawable(getApplicationContext(), R.drawable.ic_action_call)); Float rating = Float.parseFloat(getRating()); mRatingBar.setRating(rating); diff --git a/Nearby/src/main/res/layout/main.xml b/Nearby/src/main/res/layout/main.xml index 780f0fa160..032c23d02c 100644 --- a/Nearby/src/main/res/layout/main.xml +++ b/Nearby/src/main/res/layout/main.xml @@ -4,22 +4,22 @@ android:layout_height="match_parent" android:orientation="vertical" > - - + + + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight=".55" + android:id="@+id/placeLayout" + android:orientation="vertical" + android:padding="@dimen/small_space"> + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textAppearance="?android:attr/textAppearanceLarge" + android:text="" + android:id="@+id/titleTextView" + android:padding="@dimen/small_space" + android:background="@color/ui_highlight" /> - + + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textAppearance="?android:attr/textAppearanceLarge" + android:text="" + android:id="@+id/phoneTextView" + android:padding="@dimen/small_space" /> + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:id="@+id/ratingBar" + android:progressTint="@color/ratings" + android:visibility="gone"/> - \ No newline at end of file + \ No newline at end of file diff --git a/Nearby/src/main/res/menu/menu_layout.xml b/Nearby/src/main/res/menu/menu_layout.xml index 79b2628c67..43f7766025 100644 --- a/Nearby/src/main/res/menu/menu_layout.xml +++ b/Nearby/src/main/res/menu/menu_layout.xml @@ -1,29 +1,30 @@ - + \ No newline at end of file diff --git a/Nearby/src/main/res/values/styles.xml b/Nearby/src/main/res/values/styles.xml new file mode 100644 index 0000000000..00a7ff8f21 --- /dev/null +++ b/Nearby/src/main/res/values/styles.xml @@ -0,0 +1,8 @@ + + + + + +