finished adding description
This commit is contained in:
parent
5d33269b15
commit
18216adfae
3 changed files with 18 additions and 3 deletions
|
@ -353,7 +353,7 @@ public class DBHelper extends SQLiteOpenHelper {
|
|||
if (phonenumber != null && !phonenumber.equals(""))values.put(COLUMN_PHONE, phonenumber);
|
||||
if (companyname != null && !companyname.equals(""))values.put(COLUMN_COMPANY, companyname);
|
||||
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+" = ?",
|
||||
|
|
|
@ -37,12 +37,12 @@ public class SignUpPart2 extends AppCompatActivity {
|
|||
if(companyname.length()>0 && address.length()>0 && phonenumber.length()>0
|
||||
&& 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}$")
|
||||
&& description.matches("^[a-zA-Z0-9_ ]*$")
|
||||
&& companyname.replaceAll("\\s+","").length()>0
|
||||
&& address.replaceAll("\\s+","").length()>0) {
|
||||
|
||||
ServiceProvider serviceProvider = new ServiceProvider(username, password, firstname, lastname,
|
||||
address, phonenumber, companyname, licensed);
|
||||
serviceProvider.setDescription(description);
|
||||
address, phonenumber, companyname, licensed, description);
|
||||
if(dbHelper.addUser(serviceProvider)){
|
||||
startActivity(intent);
|
||||
finish();
|
||||
|
|
|
@ -80,6 +80,21 @@
|
|||
android:buttonTint="@color/colorWhite"
|
||||
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
|
||||
android:id="@+id/SignUp"
|
||||
android:layout_width="match_parent"
|
||||
|
|
Loading…
Reference in a new issue