forked from organicmaps/organicmaps
navigation buttons are positioned at top-right side of display.
This commit is contained in:
parent
b6d8c6fbad
commit
78e435a47c
2 changed files with 13 additions and 3 deletions
|
@ -9,7 +9,7 @@
|
|||
android:id="@+id/navigation_buttons_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="fill_parent"
|
||||
android:gravity="bottom"
|
||||
android:gravity="top"
|
||||
android:layout_gravity="right"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/zoom_in_button"
|
||||
android:onClick="onPlusClicked"
|
||||
android:layout_marginTop="10dip"
|
||||
android:layout_marginTop="5dip"
|
||||
android:layout_marginBottom="5dip"
|
||||
android:layout_marginLeft="5dip"
|
||||
android:layout_marginRight="5dip"/>
|
||||
|
@ -33,7 +33,7 @@
|
|||
android:layout_marginTop="5dip"
|
||||
android:layout_marginLeft="5dip"
|
||||
android:layout_marginRight="5dip"
|
||||
android:layout_marginBottom="58dip"/>
|
||||
android:layout_marginBottom="5dip"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ import android.view.MenuInflater;
|
|||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.mapswithme.maps.location.LocationService;
|
||||
import com.nvidia.devtech.NvEventQueueActivity;
|
||||
|
@ -330,6 +331,15 @@ public class MWMActivity extends NvEventQueueActivity implements LocationService
|
|||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||
|
||||
double k = metrics.density;
|
||||
|
||||
int offs = (int)(53 * k); // height of button + half space between buttons.
|
||||
|
||||
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
lp.setMargins((int)(5 * k), (int)(metrics.heightPixels / 4) - offs, (int)(5 * k), (int)(5 * k));
|
||||
findViewById(R.id.map_button_plus).setLayoutParams(lp);
|
||||
|
||||
//m_timer = new VideoTimer();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue