Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Below (especially in <code>fixMapControlLocations</code>) i've addressed this with ActionBarSherlock. </p> <p>Issues I had were on narrow screens, and the split action bar having the wrong offset depending on rotation. The <code>isNarrow</code> check through sherlock lets me know if its narrow. </p> <p>Another key change is i'm setting the padding of the myLocation's parent's parent view. This picks up all controls inside, and based on hierarchyviewer is how google maps is doing it. The Google attribution logo is on the next parent up the tree in a Surface object. Not looking like that is easily movable, so i'm probably just going to end up loosing the bottom action bar's transparency effect to stay in compliance.</p> <pre><code>protected void onCreate(Bundle savedInstanceState) { getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY); super.onCreate(savedInstanceState); setContentView(R.layout.map); setUpMapIfNeeded(); getSupportActionBar().setBackgroundDrawable(d); getSupportActionBar().setSplitBackgroundDrawable(d); } private void setUpMapIfNeeded() { // Do a null check to confirm that we have not already instantiated the // map. if (map == null) { // Try to obtain the map from the SupportMapFragment. map = ((SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map)).getExtendedMap(); // Check if we were successful in obtaining the map. if (map != null) { setUpMap(); } } } private void setUpMap() { fixMapControlLocations(); ..... } private void fixMapControlLocations() { SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map); int actionBarHeight = 0; TypedValue tv = new TypedValue(); if (getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) { actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data,getResources().getDisplayMetrics()); } View myLocationParent = ((View)mapFragment.getView().findViewById(1).getParent()); View myLocationParentParent = ((View)myLocationParent.getParent()); myLocationParentParent.setPadding(0, actionBarHeight, 0, isNarrow()?actionBarHeight:0); } public boolean isNarrow() { return ResourcesCompat.getResources_getBoolean(getApplicationContext(), R.bool.abs__split_action_bar_is_narrow); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload