Giter Club home page Giter Club logo

Comments (10)

yarolegovich avatar yarolegovich commented on May 31, 2024

I don't understand what do you mean by padding here. Title, summary, icon and other components of AbsMaterialPreferences subclasses have predefined paddings.
As for the default value - yeah, good point. Will add this when I have time.

from materialpreferences.

BarisF avatar BarisF commented on May 31, 2024

Here what i want to say, without padding and with padding and divider using linearlayout.
nopadding
padding

from materialpreferences.

yarolegovich avatar yarolegovich commented on May 31, 2024

Send your xml please.

from materialpreferences.

BarisF avatar BarisF commented on May 31, 2024

I use LinearLayout with android:paddingStart and android:paddingEnd because it's not possible with MaterialStandardPreference, ...

` < com.yarolegovich.mp.MaterialPreferenceCategory
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/pref_cat_general"
app:mpc_title="@string/pref_general"
android:padding="16dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingStart="@dimen/activity_horizontal_margin"
            android:paddingEnd="@dimen/activity_horizontal_margin"
            android:divider="@drawable/divider"
            android:showDividers="middle"
            android:orientation="vertical">

            <com.yarolegovich.mp.MaterialChoicePreference
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:id="@+id/pref_language"
                app:mp_key="pref_key_language"
                app:mp_default_value="English"
                app:mp_title="@string/pref_title_languages"
                app:mp_show_value="onRight"
                app:mp_entry_values="@array/languages" />

            <com.yarolegovich.mp.MaterialStandardPreference
                android:layout_width="match_parent"
                android:layout_height="50dp"
                app:mp_title="Copyright"
                app:mp_summary="Inovim @ 2016" />

            <com.yarolegovich.mp.MaterialStandardPreference
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:id="@+id/pref_version"
                app:mp_key="pref_key_version"
                app:mp_title="Version" />
        </LinearLayout>

    </com.yarolegovich.mp.MaterialPreferenceCategory>`

from materialpreferences.

yarolegovich avatar yarolegovich commented on May 31, 2024

What version are you testing on? LinearLayout is not needed there, paddings should already be applied (no need to specify them in preference category too).
And better not hardcode height, this can cut some part of info.
https://pp.vk.me/c630322/v630322751/31fad/HA_CLCLrQ90.jpg
https://pp.vk.me/c630322/v630322751/31fa3/ncLIWfzp1W0.jpg

from materialpreferences.

BarisF avatar BarisF commented on May 31, 2024

Api 18 it's not working, then I add LinearLayout, tested on API 23 it's working but I need for API 18.

from materialpreferences.

yarolegovich avatar yarolegovich commented on May 31, 2024

I figured it out. Think this is due to support library update. For some reason

setBackgroundResource(Utils.clickableBackground(getContext()));

Removed paddings on pre-lollipop. Will push an update in 10 minutes. Thank you for pointing.
https://github.com/yarolegovich/MaterialPreferences/blob/master/library/src/main/java/com/yarolegovich/mp/AbsMaterialPreference.java#L213

from materialpreferences.

BarisF avatar BarisF commented on May 31, 2024

Ok thanks, It'll be good too to put divider for MaterialPreferenceCategory.

from materialpreferences.

yarolegovich avatar yarolegovich commented on May 31, 2024

use version 1.0.5 now. should work.
as for dividers - I don't have time now, maybe later. or you can do it yourself and create a pull request ;)

from materialpreferences.

BarisF avatar BarisF commented on May 31, 2024

Ok if I've time too.

from materialpreferences.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.