Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add preferences #84

Merged
merged 3 commits into from
May 8, 2018
Merged

Add preferences #84

merged 3 commits into from
May 8, 2018

Conversation

filol
Copy link

@filol filol commented May 6, 2018

  • Add CheckBox
  • Add Switch
  • Update gradle
  • Change deprecated function inside build.gradle
  • Update README
  • Update DemoApp for testing preferences items
  • Add french translation

#77

@@ -25,18 +25,18 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
implementation fileTree(dir: 'libs', include: ['*.jar'])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

Copy link
Owner

@daniel-stoneuk daniel-stoneuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, would you kindly change a few things before I merge :)

README.md Outdated
@@ -162,10 +162,12 @@ MaterialAboutCard card = new MaterialAboutCard.Builder()

### Add Items to a card:

There are currently two types of items you can add to a card - [`MaterialAboutTitleItem`][9] and [`MaterialAboutActionItem`][10]. Other types of items are planned, for example "person" items which feature buttons to showcase a single person. Feel free to submit a PR or Issue for more item ideas.
There are currently 4 types of items you can add to a card - [`MaterialPreferenceTitleItem`][9], [`MaterialPreferenceActionItem`][10], [`MaterialPreferenceCheckboxItem`][12] and [`MaterialPreferenceSwitchItem`][13]. Other types of items are planned, for example "person" items which feature buttons to showcase a single person. Feel free to submit a PR or Issue for more item ideas.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use the naming convention MaterialAboutCheckboxItem and MaterialAboutTitleItem etc. Thanks

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oups

build.gradle Outdated
@@ -28,6 +28,7 @@ ext {
minSdkVersion = 14

supportLibVersion = '27.1.1'
constraintLayoutLibVersion = '1.1.0'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the constraint layout library used at all?

/**
* Created by François Dexemple on 04/05/2018
*/
public interface MaterialAboutOnCheckedChangedListener {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename this to MaterialAboutItemOnCheckedChangedAction for consistency. Thanks

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I will do it but it's not really an action (like click), it's a listener

@@ -1,28 +1,39 @@
package com.danielstone.materialaboutlibrary.util;

import android.content.Context;
import android.icu.util.ValueIterator;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this import used?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, I delete it

@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh. Could you possibly create the layout with LinearLayouts etc, just to keep dependencies down when not needed. :)

@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

@filol
Copy link
Author

filol commented May 7, 2018

I made the corrections. The only details I did not manage to do with Linear layout is to center the switch and the checkbox. You'll see when you put a checkbox under a switch that they are not centered

@daniel-stoneuk daniel-stoneuk changed the base branch from master to preferences May 8, 2018 07:46
@daniel-stoneuk
Copy link
Owner

Thanks! I'll check it out and merge onto master branch later

@daniel-stoneuk daniel-stoneuk merged commit 6103db6 into daniel-stoneuk:preferences May 8, 2018
@filol
Copy link
Author

filol commented May 8, 2018

I forget some error in the README. See PR #86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants