[android] added +- button to MapView with placeholder icons.

This commit is contained in:
rachytski 2012-07-09 02:52:33 -07:00 committed by Alex Zolotarev
parent 15c3b154f8
commit 60000ffc75
23 changed files with 67 additions and 0 deletions

View file

@ -475,4 +475,9 @@ namespace android
{
m_work.AddString(name, value);
}
void Framework::Scale(double k)
{
m_work.Scale(k);
}
}

View file

@ -101,6 +101,8 @@ namespace android
string const GetCountryName(double x, double y) const;
void AddString(string const & name, string const & value);
void Scale(double k);
};
}

View file

@ -218,4 +218,10 @@ extern "C"
env->SetObjectArrayElement(ret, i, env->NewStringUTF(v[i].c_str()));
return ret;
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_MWMActivity_nativeScale(JNIEnv * env, jobject thiz, jdouble k)
{
g_framework->Scale(static_cast<double>(k));
}
} // extern "C"

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7 KiB

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_pressed="true"
android:drawable="@drawable/ic_minus_highlighted" />
<item android:drawable="@drawable/ic_minus" />
</selector>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_pressed="true"
android:drawable="@drawable/ic_plus_highlighted" />
<item android:drawable="@drawable/ic_plus" />
</selector>

View file

@ -4,7 +4,39 @@
<android.view.SurfaceView android:id="@+id/map_surfaceview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
<LinearLayout
android:id="@+id/navigation_buttons_container"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="bottom"
android:layout_gravity="right"
android:orientation="vertical">
<Button
android:id="@+id/map_button_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/plus_button"
android:onClick="onPlusClicked"
android:layout_marginTop="10dip"
android:layout_marginBottom="5dip"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"/>
<Button
android:id="@+id/map_button_minus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/minus_button"
android:onClick="onMinusClicked"
android:layout_marginTop="5dip"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:layout_marginBottom="58dip"/>
</LinearLayout>
<LinearLayout
android:id="@+id/map_butons_container"
android:layout_width="fill_parent"

View file

@ -160,9 +160,19 @@ public class MWMActivity extends NvEventQueueActivity implements LocationService
private native int nativeGetMS();
private native void nativeSetMS(int u);
private native void nativeScale(double k);
private static final String PREFERENCES_MYPOSITION = "isMyPositionEnabled";
public void onPlusClicked(View v)
{
nativeScale(3.0 / 2);
}
public void onMinusClicked(View v)
{
nativeScale(2.0 / 3);
}
public void onMyPositionClicked(View v)
{