finished adding description

This commit is contained in:
IvanaE 2018-11-17 14:29:46 -05:00
parent 5d33269b15
commit 18216adfae
3 changed files with 18 additions and 3 deletions

View file

@ -353,7 +353,7 @@ public class DBHelper extends SQLiteOpenHelper {
if (phonenumber != null && !phonenumber.equals(""))values.put(COLUMN_PHONE, phonenumber); if (phonenumber != null && !phonenumber.equals(""))values.put(COLUMN_PHONE, phonenumber);
if (companyname != null && !companyname.equals(""))values.put(COLUMN_COMPANY, companyname); if (companyname != null && !companyname.equals(""))values.put(COLUMN_COMPANY, companyname);
if (licensed != null) values.put(COLUMN_LICENSED, String.valueOf(licensed)); if (licensed != null) values.put(COLUMN_LICENSED, String.valueOf(licensed));
if (description != null && !description.equals(""))values.put(COLUMN_DESCRIPTION, description); if (description != null )values.put(COLUMN_DESCRIPTION, description);
return writeDB.update(TABLE_LOGIN, values, COLUMN_USERNAME+" = ?", return writeDB.update(TABLE_LOGIN, values, COLUMN_USERNAME+" = ?",

View file

@ -37,12 +37,12 @@ public class SignUpPart2 extends AppCompatActivity {
if(companyname.length()>0 && address.length()>0 && phonenumber.length()>0 if(companyname.length()>0 && address.length()>0 && phonenumber.length()>0
&& companyname.matches("^[a-zA-Z0-9_ ]*$") && address.matches("^[a-zA-Z0-9_ ]*$") && companyname.matches("^[a-zA-Z0-9_ ]*$") && address.matches("^[a-zA-Z0-9_ ]*$")
&& phonenumber.matches("^(\\+\\d{1,2}\\s)?\\(?\\d{3}\\)?[\\s.-]?\\d{3}[\\s.-]?\\d{4}$") && phonenumber.matches("^(\\+\\d{1,2}\\s)?\\(?\\d{3}\\)?[\\s.-]?\\d{3}[\\s.-]?\\d{4}$")
&& description.matches("^[a-zA-Z0-9_ ]*$")
&& companyname.replaceAll("\\s+","").length()>0 && companyname.replaceAll("\\s+","").length()>0
&& address.replaceAll("\\s+","").length()>0) { && address.replaceAll("\\s+","").length()>0) {
ServiceProvider serviceProvider = new ServiceProvider(username, password, firstname, lastname, ServiceProvider serviceProvider = new ServiceProvider(username, password, firstname, lastname,
address, phonenumber, companyname, licensed); address, phonenumber, companyname, licensed, description);
serviceProvider.setDescription(description);
if(dbHelper.addUser(serviceProvider)){ if(dbHelper.addUser(serviceProvider)){
startActivity(intent); startActivity(intent);
finish(); finish();

View file

@ -80,6 +80,21 @@
android:buttonTint="@color/colorWhite" android:buttonTint="@color/colorWhite"
android:layout_marginBottom="15dp"/> android:layout_marginBottom="15dp"/>
//component used from https://github.com/rengwuxian/MaterialEditText
<com.rengwuxian.materialedittext.MaterialEditText
android:id="@+id/DescriptionInput"
android:layout_width="match_parent"
android:layout_height="80dp"
android:background="@drawable/customborder"
android:hint="General Description"
android:text=""
android:textSize="15sp"
app:met_baseColor="@android:color/white"
app:met_floatingLabel="highlight"
app:met_primaryColor="@color/colorWhite"
app:met_singleLineEllipsis="true"
android:textCursorDrawable="@color/colorWhite"/>
<Button <Button
android:id="@+id/SignUp" android:id="@+id/SignUp"
android:layout_width="match_parent" android:layout_width="match_parent"