From a350247d007db46c1953380dd38b7597ba9a194d Mon Sep 17 00:00:00 2001 From: Denis Date: Mon, 3 Nov 2014 17:53:43 +0200 Subject: [PATCH] Simplified code --- .../net/osmand/plus/activities/actions/AppModeDialog.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java b/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java index 3e1eb9536d..ebe54e0962 100644 --- a/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java +++ b/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java @@ -243,13 +243,13 @@ public class AppModeDialog { } static private ToggleButton createToggle(Context ctx, LinearLayout layout, ApplicationMode mode, boolean drawer){ - int left = 0; + int margin = 0; if (drawer) { - left = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 5, ctx.getResources().getDisplayMetrics()); + margin = 5; } else { - left = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10, ctx.getResources().getDisplayMetrics()); + margin = 10; } - + int left = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, margin, ctx.getResources().getDisplayMetrics()); int metrics = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 64, ctx.getResources().getDisplayMetrics()); ToggleButton tb = new ToggleButton(ctx); tb.setTextOn("");