0

I am trying to create Facebook like slider from the following answer, where i want to change map width at a run time.

I tried inside bindComponent method , but its not working for me..

map.xml

<?xml version="1.0" encoding="utf-8"?>

 <fragment xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/mapView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        class="com.google.android.gms.maps.SupportMapFragment" />

Activity

public class MapActivity extends FragmentActivity implements
     OnClickListener {


private ImageView mSlider;
LinearLayout.LayoutParams mapViewParameters;
GoogleMap gMap;
SupportMapFragment supportMap;
private DisplayMetrics metrics;


@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.slider);

    bindComponents();

}



private void bindComponents() {
    // TODO Auto-generated method stub

    supportMap = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.mapView);

    metrics = new DisplayMetrics();

    mapViewParameters = (LinearLayout.LayoutParams) findViewById(
            R.id.mapView).getLayoutParams();
    mapViewParameters.width = metrics.widthPixels;
    findViewById(R.id.mapView).setLayoutParams(mapViewParameters);

    // Map
    gMap = supportMap.getMap();
    gMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);

    mSlider = (ImageView) findViewById(R.id.msliderImage);




}
  }

Any Help would be highly appreciated.

Community
  • 1
  • 1
moDev
  • 5,248
  • 4
  • 33
  • 63

1 Answers1

0

I would recomend you check this library. I think it's best i ever seen in web for implementing Facebook like Sliding Menu

Evos
  • 3,915
  • 2
  • 18
  • 21
  • 1
    @Mitesh Agrawal yes i am....and my answer is the same. Component you using is defenately NOT the best one so i recomend you to change it. – Evos Jan 24 '13 at 12:16