parse-community / ParseUI-Android

ParseUI contains user interface libraries for building apps with the Parse Android SDK.
Other
592 stars 323 forks source link

Allow disable name field in signup form #97

Closed wangmengyan95 closed 8 years ago

wangmengyan95 commented 8 years ago

Allow users to disable name field in the signup form #43 Developers now can disable the name field 1.In the AndroidManifest.xml

<activity
    android:name="com.parse.ui.ParseLoginActivity"
    android:label="@string/app_name"
    android:launchMode="singleTop">
    <meta-data
        android:name="com.parse.ui.ParseLoginActivity.PARSE_SIGNUP_NAME_FIELD_ENABLED"
        android:value="false"/>
</activity>

2.In ParseLoginBuilder

ParseLoginBuilder loginBuilder = new ParseLoginBuilder(getApplicationContext());
loginBuilder.setParseSignupNameFieldEnabled(false);

image

Test:

  1. Do the configuration in AndroidManifest.xml, check whether the name field disable or not, check wether we can signup or not
  2. Do the configuration in ParseLoginBuilder, check whether the name field disable or not, check wether we can signup or not
  3. Do not do any configuration, make sure the name field shows and we can signup
hallucinogen commented 8 years ago

2 questions here

  1. I assume doing android:name="com.parse.ui.ParseLoginActivity.PARSE_SIGNUP_NAME_FIELD_ENABLED" is the usual pattern here?
  2. What happen if I set the metadata in AndroidManifest.xml to false and call set setParseSignupNameFieldEnabled manually from the code to true?

Otherwise the code LGTM.

wangmengyan95 commented 8 years ago

@hallucinogen

  1. I think so, I follow the naming convention here.
  2. ParseLoginBuilder's settings will overwrite the settings in AndroidManifest.xml. This is our default behaviour, check here.
hallucinogen commented 8 years ago

kk LGTM.