{"action":"opened","issue":{"url":"https://api.github.com/repos/iBis-project/iBis-Android-App/issues/17","labels_url":"https://api.github.com/repos/iBis-project/iBis-Android-App/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/iBis-project/iBis-Android-App/issues/17/comments","events_url":"https://api.github.com/repos/iBis-project/iBis-Android-App/issues/17/events","html_url":"https://github.com/iBis-project/iBis-Android-App/issues/17","id":103483992,"number":17,"title":"Avoid using \"px\" as units; use \"dp\" instead","user":{"login":"rleh","id":2820734,"avatar_url":"https://avatars.githubusercontent.com/u/2820734?v=3","gravatar_id":"","url":"https://api.github.com/users/rleh","html_url":"https://github.com/rleh","followers_url":"https://api.github.com/users/rleh/followers","following_url":"https://api.github.com/users/rleh/following{/other_user}","gists_url":"https://api.github.com/users/rleh/gists{/gist_id}","starred_url":"https://api.github.com/users/rleh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rleh/subscriptions","organizations_url":"https://api.github.com/users/rleh/orgs","repos_url":"https://api.github.com/users/rleh/repos","events_url":"https://api.github.com/users/rleh/events{/privacy}","received_events_url":"https://api.github.com/users/rleh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/iBis-project/iBis-Android-App/labels/suggestion","name":"suggestion","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-27T11:07:48Z","updated_at":"2015-08-27T11:07:48Z","closed_at":"2015-08-27T11:07:48Z","body":"PxUsage: Using 'px' dimension\r\n../../src/main/res/layout/activity_main.xml:6: Avoid using \"px\" as units; use \"dp\" instead\r\n\r\n   3         android:layout_width=\"match_parent\"\r\n   4         android:layout_height=\"match_parent\"\r\n   5         android:orientation=\"vertical\"\r\n   6         android:padding=\"10px\">\r\n   7 \r\n   8         <TextView\r\n\r\n../../src/main/res/layout/activity_main.xml:20: Avoid using \"px\" as units; use \"dp\" instead\r\n\r\n  17             android:layout_width=\"wrap_content\"\r\n  18             android:layout_height=\"wrap_content\"\r\n  19             android:text=\"@string/welcome\"\r\n  20             android:paddingBottom=\"10px\"/>\r\n  21 \r\n  22         <Button\r\n\r\n../../src/main/res/layout/activity_settings.xml:5: Avoid using \"px\" as units; use \"dp\" instead\r\n\r\n   2     android:layout_width=\"match_parent\"\r\n   3     android:layout_height=\"match_parent\"\r\n   4     android:orientation=\"vertical\"\r\n   5     android:padding=\"10px\">\r\n   6 \r\n   7     <TextView\r\n\r\n../../src/main/res/layout/activity_settings.xml:10: Avoid using \"px\" as units; use \"dp\" instead\r\n\r\n   7     <TextView\r\n   8         android:layout_width=\"wrap_content\"\r\n   9         android:layout_height=\"wrap_content\"\r\n  10         android:layout_marginBottom=\"10px\"\r\n  11         android:layout_marginTop=\"5px\"\r\n  12         android:text=\"@string/general_settings\"\r\n\r\n../../src/main/res/layout/activity_settings.xml:11: Avoid using \"px\" as units; use \"dp\" instead\r\n\r\n   8         android:layout_width=\"wrap_content\"\r\n   9         android:layout_height=\"wrap_content\"\r\n  10         android:layout_marginBottom=\"10px\"\r\n  11         android:layout_marginTop=\"5px\"\r\n  12         android:text=\"@string/general_settings\"\r\n  13         android:textSize=\"20sp\" />\r\n\r\n../../src/main/res/layout/activity_settings.xml:25: Avoid using \"px\" as units; use \"dp\" instead\r\n\r\n  22     <TextView\r\n  23         android:layout_width=\"wrap_content\"\r\n  24         android:layout_height=\"wrap_content\"\r\n  25         android:layout_marginBottom=\"10px\"\r\n  26         android:layout_marginTop=\"50px\"\r\n  27         android:text=\"@string/specific_settings\"\r\n\r\n../../src/main/res/layout/activity_settings.xml:26: Avoid using \"px\" as units; use \"dp\" instead\r\n\r\n  23         android:layout_width=\"wrap_content\"\r\n  24         android:layout_height=\"wrap_content\"\r\n  25         android:layout_marginBottom=\"10px\"\r\n  26         android:layout_marginTop=\"50px\"\r\n  27         android:text=\"@string/specific_settings\"\r\n  28         android:textSize=\"20sp\" />\r\n\r\n../../src/main/res/layout/activity_settings.xml:33: Avoid using \"px\" as units; use \"dp\" instead\r\n\r\n  30     <TextView\r\n  31         android:layout_width=\"wrap_content\"\r\n  32         android:layout_height=\"wrap_content\"\r\n  33         android:layout_marginBottom=\"10px\"\r\n  34         android:text=\"@string/distance\" />\r\n  35 \r\n\r\n../../src/main/res/layout/activity_settings.xml:39: Avoid using \"px\" as units; use \"dp\" instead\r\n\r\n  36     <LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n  37         android:layout_width=\"match_parent\"\r\n  38         android:layout_height=\"wrap_content\"\r\n  39         android:layout_marginBottom=\"10px\"\r\n  40         android:layout_marginTop=\"10px\"\r\n  41         android:orientation=\"horizontal\">\r\n\r\n../../src/main/res/layout/activity_settings.xml:40: Avoid using \"px\" as units; use \"dp\" instead\r\n\r\n  37         android:layout_width=\"match_parent\"\r\n  38         android:layout_height=\"wrap_content\"\r\n  39         android:layout_marginBottom=\"10px\"\r\n  40         android:layout_marginTop=\"10px\"\r\n  41         android:orientation=\"horizontal\">\r\n  42 \r\n\r\n../../src/main/res/layout/activity_settings.xml:60: Avoid using \"px\" as units; use \"dp\" instead\r\n\r\n  57     <LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n  58         android:layout_width=\"match_parent\"\r\n  59         android:layout_height=\"wrap_content\"\r\n  60         android:layout_marginBottom=\"10px\"\r\n  61         android:layout_marginTop=\"30px\"\r\n  62         android:orientation=\"horizontal\">\r\n\r\n../../src/main/res/layout/activity_settings.xml:61: Avoid using \"px\" as units; use \"dp\" instead\r\n\r\n  58         android:layout_width=\"match_parent\"\r\n  59         android:layout_height=\"wrap_content\"\r\n  60         android:layout_marginBottom=\"10px\"\r\n  61         android:layout_marginTop=\"30px\"\r\n  62         android:orientation=\"horizontal\">\r\n  63 \r\n\r\n../../src/main/res/layout/activity_settings.xml:82: Avoid using \"px\" as units; use \"dp\" instead\r\n\r\n  79     <Button\r\n  80         android:layout_width=\"match_parent\"\r\n  81         android:layout_height=\"wrap_content\"\r\n  82         android:layout_marginTop=\"10px\"\r\n  83         android:text=\"@string/setTime\"\r\n  84         android:onClick=\"showTimePickerDialog\" />\r\n\r\n../../src/main/res/layout/activity_settings.xml:90: Avoid using \"px\" as units; use \"dp\" instead\r\n\r\n  87     <Button\r\n  88         android:layout_width=\"match_parent\"\r\n  89         android:layout_height=\"wrap_content\"\r\n  90         android:layout_marginTop=\"50px\"\r\n  91         android:onClick=\"saveSettings\"\r\n  92         android:text=\"@string/save\" />\r\n\r\n../../src/main/res/layout/activity_settings.xml:97: Avoid using \"px\" as units; use \"dp\" instead\r\n\r\n  94     <Button\r\n  95         android:layout_width=\"match_parent\"\r\n  96         android:layout_height=\"wrap_content\"\r\n  97         android:layout_marginTop=\"50px\"\r\n  98         android:onClick=\"onClickstopOnlineTracking\"\r\n  99         android:text=\"@string/tracking_stop\" />\r\n\r\nNote: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ Fix\r\nPriority: 2 / 10\r\nCategory: Correctness\r\nSeverity: Warning\r\nExplanation: Using 'px' dimension.\r\nFor performance reasons and to keep the code simpler, the Android system uses pixels as the standard unit for expressing dimension or coordinate values. That means that the dimensions of a view are always expressed in the code using pixels, but always based on the current screen density. For instance, if myView.getWidth() returns 10, the view is 10 pixels wide on the current screen, but on a device with a higher density screen, the value returned might be 15. If you use pixel values in your application code to work with bitmaps that are not pre-scaled for the current screen density, you might need to scale the pixel values that you use in your code to match the un-scaled bitmap source.\r\n\r\nMore info: http://developer.android.com/guide/practices/screens_support.html#screen-independence\r\n\r\nTo suppress this error, use the issue id \"PxUsage\" as explained in the Suppressing Warnings and Errors section.\n\n_This issue was migrated from GitLab. Original author is Raphael Lehmann._\n_It was originally created 2015-02-01 18:04._"}}