{"action":"created","issue":{"url":"https://api.github.com/repos/consp1racy/android-support-preference/issues/42","repository_url":"https://api.github.com/repos/consp1racy/android-support-preference","labels_url":"https://api.github.com/repos/consp1racy/android-support-preference/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/consp1racy/android-support-preference/issues/42/comments","events_url":"https://api.github.com/repos/consp1racy/android-support-preference/issues/42/events","html_url":"https://github.com/consp1racy/android-support-preference/issues/42","id":167237191,"number":42,"title":"Set title and summary on multilines","user":{"login":"peppe130","id":6855692,"avatar_url":"https://avatars.githubusercontent.com/u/6855692?v=3","gravatar_id":"","url":"https://api.github.com/users/peppe130","html_url":"https://github.com/peppe130","followers_url":"https://api.github.com/users/peppe130/followers","following_url":"https://api.github.com/users/peppe130/following{/other_user}","gists_url":"https://api.github.com/users/peppe130/gists{/gist_id}","starred_url":"https://api.github.com/users/peppe130/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peppe130/subscriptions","organizations_url":"https://api.github.com/users/peppe130/orgs","repos_url":"https://api.github.com/users/peppe130/repos","events_url":"https://api.github.com/users/peppe130/events{/privacy}","received_events_url":"https://api.github.com/users/peppe130/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-24T14:54:51Z","updated_at":"2016-07-24T17:12:12Z","closed_at":"2016-07-24T17:12:12Z","body":"Hi,\r\n\r\nPlease add a parameter to set both title and summary of a CheckBoxPreference on multilines because, for example, when I use a long title it get cut and hidden. I wrote a custom CheckBoxPreference based on yours:\r\n\r\n```java\r\n\r\n    @Override\r\n    public void onBindViewHolder(final PreferenceViewHolder holder) {\r\n        super.onBindViewHolder(holder);\r\n\r\n        TextView mTitle = (TextView) holder.findViewById(android.R.id.title);\r\n        mTitle.setSingleLine(false);\r\n\r\n        View checkboxView = holder.findViewById(android.R.id.checkbox);\r\n        if (checkboxView == null) {\r\n            checkboxView = holder.findViewById(R.id.checkbox);\r\n        }\r\n        if (checkboxView instanceof Checkable) {\r\n            ((Checkable) checkboxView).setChecked(mChecked);\r\n        }\r\n\r\n        syncSummaryView(holder);\r\n    }\r\n\r\n```\r\n\r\nThis is the custom `onBindViewHolder` method I'm using currently. Thank you for your work."},"comment":{"url":"https://api.github.com/repos/consp1racy/android-support-preference/issues/comments/234789291","html_url":"https://github.com/consp1racy/android-support-preference/issues/42#issuecomment-234789291","issue_url":"https://api.github.com/repos/consp1racy/android-support-preference/issues/42","id":234789291,"user":{"login":"consp1racy","id":4589773,"avatar_url":"https://avatars.githubusercontent.com/u/4589773?v=3","gravatar_id":"","url":"https://api.github.com/users/consp1racy","html_url":"https://github.com/consp1racy","followers_url":"https://api.github.com/users/consp1racy/followers","following_url":"https://api.github.com/users/consp1racy/following{/other_user}","gists_url":"https://api.github.com/users/consp1racy/gists{/gist_id}","starred_url":"https://api.github.com/users/consp1racy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/consp1racy/subscriptions","organizations_url":"https://api.github.com/users/consp1racy/orgs","repos_url":"https://api.github.com/users/consp1racy/repos","events_url":"https://api.github.com/users/consp1racy/events{/privacy}","received_events_url":"https://api.github.com/users/consp1racy/received_events","type":"User","site_admin":false},"created_at":"2016-07-24T17:12:12Z","updated_at":"2016-07-24T17:12:12Z","body":"Your titles should fit one line no problem. Check this for guidelines https://material.google.com/patterns/settings.html#settings-placement.\r\n\r\npreference-v7 limits are even worse (1/4) than mine (1/10), that should hint you into being more effective while writing settings labels. Nobody likes to read them. Be short and clear.\r\n\r\n---\r\n\r\nI will not be changing these limits, however...\r\n\r\nPut this in your `res/layout` folder to alter base preference layout:\r\n\r\n### asp_preference.xml\r\n```\r\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<LinearLayout\r\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n    xmlns:tools=\"http://schemas.android.com/tools\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"wrap_content\"\r\n    android:background=\"?selectableItemBackground\"\r\n    android:baselineAligned=\"false\"\r\n    android:clipToPadding=\"false\"\r\n    android:gravity=\"center_vertical\"\r\n    android:minHeight=\"?listPreferredItemHeightSmall\"\r\n    android:paddingLeft=\"?listPreferredItemPaddingLeft\"\r\n    android:paddingRight=\"?listPreferredItemPaddingRight\"\r\n    tools:ignore=\"RtlHardcoded\">\r\n\r\n    <FrameLayout\r\n        android:id=\"@+id/icon_frame\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_marginEnd=\"12dp\"\r\n        android:layout_marginLeft=\"-4dp\"\r\n        android:layout_marginRight=\"12dp\"\r\n        android:layout_marginStart=\"-4dp\"\r\n        android:minWidth=\"48dp\"\r\n        android:visibility=\"gone\"\r\n        tools:visibility=\"visible\">\r\n\r\n        <ImageView\r\n            android:id=\"@android:id/icon\"\r\n            android:layout_width=\"wrap_content\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:maxHeight=\"48dp\"\r\n            android:maxWidth=\"48dp\"\r\n            android:scaleType=\"fitStart\"\r\n            android:visibility=\"gone\"\r\n            tools:ignore=\"ContentDescription\"\r\n            tools:visibility=\"visible\"/>\r\n    </FrameLayout>\r\n\r\n    <LinearLayout\r\n        android:layout_width=\"0dp\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_weight=\"1\"\r\n        android:orientation=\"vertical\"\r\n        android:paddingBottom=\"16dp\"\r\n        android:paddingTop=\"16dp\">\r\n\r\n        <TextView\r\n            android:id=\"@android:id/title\"\r\n            android:layout_width=\"wrap_content\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:ellipsize=\"marquee\"\r\n            maxLines=\"2\"\r\n            android:textAppearance=\"?textAppearanceListItem\"/>\r\n\r\n        <TextView\r\n            android:id=\"@android:id/summary\"\r\n            android:layout_width=\"wrap_content\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:maxLines=\"10\"\r\n            android:textAppearance=\"?asp_textAppearanceListItemSecondary\"\r\n            android:textColor=\"?android:textColorSecondary\"/>\r\n\r\n    </LinearLayout>\r\n\r\n    <!-- Preference should place its actual preference widget here. -->\r\n    <LinearLayout\r\n        android:id=\"@android:id/widget_frame\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"match_parent\"\r\n        android:layout_marginEnd=\"-16dp\"\r\n        android:layout_marginRight=\"-16dp\"\r\n        android:clipToPadding=\"false\"\r\n        android:gravity=\"end|center_vertical\"\r\n        android:orientation=\"vertical\"\r\n        android:paddingLeft=\"16dp\"\r\n        android:paddingRight=\"16dp\"/>\r\n\r\n</LinearLayout>\r\n```\r\n\r\nThis layout will affect everything except `SeekBarPreference`."}}
{"actor":{"display_login":"consp1racy"}}