Fixed Utils.dp no-op

captchafix
Florens Douwes 11 years ago
parent 8c8d6cfde1
commit 4e28980b33
  1. 4
      Chan/src/org/floens/chan/ui/activity/WatchSettingsActivity.java
  2. 4
      Chan/src/org/floens/chan/utils/Utils.java

@ -39,7 +39,7 @@ public class WatchSettingsActivity extends Activity implements OnCheckedChangeLi
watchSwitch = (Switch) menu.findItem(R.id.enable_watch_switch).getActionView();
watchSwitch.setOnCheckedChangeListener(this);
watchSwitch.setPadding(0, 0, Utils.dp(this, 20), 0);
watchSwitch.setPadding(0, 0, Utils.dp(this, 14), 0);
setEnabled(ChanPreferences.getWatchEnabled());
@ -90,7 +90,7 @@ public class WatchSettingsActivity extends Activity implements OnCheckedChangeLi
public View onCreateView(LayoutInflater inflater, ViewGroup group, Bundle savedInstanceState) {
LinearLayout container = new LinearLayout(inflater.getContext());
int p = Utils.dp(inflater.getContext(), 20);
int p = Utils.dp(inflater.getContext(), 14);
container.setPadding(p, p, p, p);
TextView text = new TextView(inflater.getContext());

@ -9,8 +9,8 @@ import android.util.TypedValue;
import android.view.View;
public class Utils {
public static int dp(Context context, int dp) {
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 14, context.getResources().getDisplayMetrics());
public static int dp(Context context, float dp) {
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, context.getResources().getDisplayMetrics());
}
/**

Loading…
Cancel
Save