[android] - parsing fragment's xml attributes
This commit is contained in:
@@ -5,9 +5,11 @@ import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.mapbox.mapboxsdk.utils.MapFragmentUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -55,6 +57,19 @@ public final class MapFragment extends Fragment implements OnMapReadyCallback {
|
||||
return mapFragment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when this fragment is inflated, parses XML tag attributes.
|
||||
*
|
||||
* @param context The context inflating this fragment.
|
||||
* @param attrs The XML tag attributes.
|
||||
* @param savedInstanceState The saved instance state for the map fragment.
|
||||
*/
|
||||
@Override
|
||||
public void onInflate(Context context, AttributeSet attrs, Bundle savedInstanceState) {
|
||||
super.onInflate(context, attrs, savedInstanceState);
|
||||
setArguments(MapFragmentUtils.createFragmentArgs(MapboxMapOptions.createFromAttributes(context, attrs)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the context attaches to this fragment.
|
||||
*
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -69,6 +70,19 @@ public class SupportMapFragment extends Fragment implements OnMapReadyCallback {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when this fragment is inflated, parses XML tag attributes.
|
||||
*
|
||||
* @param context The context inflating this fragment.
|
||||
* @param attrs The XML tag attributes.
|
||||
* @param savedInstanceState The saved instance state for the map fragment.
|
||||
*/
|
||||
@Override
|
||||
public void onInflate(Context context, AttributeSet attrs, Bundle savedInstanceState) {
|
||||
super.onInflate(context, attrs, savedInstanceState);
|
||||
setArguments(MapFragmentUtils.createFragmentArgs(MapboxMapOptions.createFromAttributes(context, attrs)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the fragment view hierarchy.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user