Skip to content

Commit

Permalink
feat: Bump Places to 2.5.0 (#263)
Browse files Browse the repository at this point in the history
Change-Id: Ia4c924843c6423a889cb02920630538c38b6afda
  • Loading branch information
arriolac committed Oct 14, 2021
1 parent e7f79f3 commit 3812669
Show file tree
Hide file tree
Showing 17 changed files with 424 additions and 236 deletions.
3 changes: 2 additions & 1 deletion demo-java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ dependencies {
implementation "androidx.activity:activity:1.3.1"
implementation "androidx.fragment:fragment:1.3.6"
implementation 'com.android.volley:volley:1.2.1'
implementation "com.github.bumptech.glide:glide:4.9.0"

// GMS
gmsImplementation 'com.google.android.libraries.places:places:2.4.0'
gmsImplementation 'com.google.android.libraries.places:places:2.5.0'
gmsImplementation 'com.google.android.gms:play-services-maps:17.0.1'
gmsImplementation 'com.google.maps.android:android-maps-utils:2.2.6'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import java.util.List;

import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.app.AlertDialog;
Expand Down Expand Up @@ -113,7 +112,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
}

@Override
protected void onSaveInstanceState(@NonNull Bundle bundle) {
protected void onSaveInstanceState(Bundle bundle) {
super.onSaveInstanceState(bundle);
fieldSelector.onSaveInstanceState(bundle);
}
Expand All @@ -138,17 +137,16 @@ private void setupAutocompleteSupportFragment() {
.setActivityMode(getMode()));
}

@NonNull
private PlaceSelectionListener getPlaceSelectionListener() {
return new PlaceSelectionListener() {
@Override
public void onPlaceSelected(@NonNull Place place) {
public void onPlaceSelected(Place place) {
responseView.setText(
StringUtil.stringifyAutocompleteWidget(place, isDisplayRawResultsChecked()));
}

@Override
public void onError(@NonNull Status status) {
public void onError(Status status) {
responseView.setText(status.getStatusMessage());
}
};
Expand Down Expand Up @@ -245,7 +243,6 @@ private String getHint() {
return getTextViewValue(R.id.autocomplete_hint);
}

@NonNull
private List<String> getCountries() {
String countryString = getTextViewValue(R.id.autocomplete_country);
if (TextUtils.isEmpty(countryString)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

import java.util.List;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresPermission;
import androidx.appcompat.app.AppCompatActivity;
Expand Down Expand Up @@ -90,7 +89,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
}

@Override
protected void onSaveInstanceState(@NonNull Bundle bundle) {
protected void onSaveInstanceState(Bundle bundle) {
super.onSaveInstanceState(bundle);
fieldSelector.onSaveInstanceState(bundle);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import java.util.List;
import java.util.Map;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;

Expand Down Expand Up @@ -166,7 +165,7 @@ public String getSelectedString() {
}


public void onSaveInstanceState(@NonNull Bundle bundle) {
public void onSaveInstanceState(Bundle bundle) {
List<Field> fields = getSelectedFields();

ArrayList<Integer> serializedFields = new ArrayList<>();
Expand Down Expand Up @@ -217,9 +216,8 @@ private static void updateView(View view, State state) {
}
}

@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
public View getView(int position, @Nullable View convertView, ViewGroup parent) {
View view = super.getView(position, convertView, parent);
State state = getItem(position);
updateView(view, state);
Expand Down
Loading

0 comments on commit 3812669

Please sign in to comment.