-
Notifications
You must be signed in to change notification settings - Fork 36
feat: Added option for Custom Pooja and Amount paid #65
Conversation
@gopikaharikumar your build is failing because of spotless Just run |
@@ -44,6 +44,9 @@ public View getView(int position, View convertView, ViewGroup parent) { | |||
|
|||
String[] str = item.getName().split(" "); | |||
String lastWord = str[0].substring(str[0].lastIndexOf(" ") + 1); | |||
if(lastWord.length()>1){ | |||
lastWord="C"; | |||
} | |||
|
|||
vh.textViewName.setText(str[1] + " " + str[2]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, it will show only 2 values add the Pojja Name
also in readAll
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the input type is numbers only in amount edit text
@@ -37,11 +40,15 @@ protected void onCreate(Bundle savedInstanceState) { | |||
insert = findViewById(R.id.insert_btn); | |||
uid1ET = findViewById(R.id.uid); | |||
nameET = findViewById(R.id.name); | |||
custompooja=(EditText)findViewById(R.id.custompooja); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant type casts. Please remove.
@@ -37,11 +40,15 @@ protected void onCreate(Bundle savedInstanceState) { | |||
insert = findViewById(R.id.insert_btn); | |||
uid1ET = findViewById(R.id.uid); | |||
nameET = findViewById(R.id.name); | |||
custompooja=(EditText)findViewById(R.id.custompooja); | |||
amount=(EditText)findViewById(R.id.amount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant type casts.
@gopikaharikumar always follow Semantic Pull Request format while sending a pr, please. |
@@ -115,7 +116,7 @@ protected Void doInBackground(Void... params) { | |||
*/ | |||
if (jsonObject != null) { | |||
JSONObject user = jsonObject.getJSONObject(getString(R.string.user)); | |||
name = user.getString(getString(R.string.name_)); | |||
name = user.getString("name"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use hardcoded strings. Revert
@@ -43,6 +46,8 @@ protected void onCreate(Bundle savedInstanceState) { | |||
poojaType = findViewById(R.id.spinner1); | |||
totalLayout = findViewById(R.id.total_View); | |||
moneyDonated = findViewById(R.id.money_donated); | |||
custompooja = (EditText) findViewById(R.id.custompooja); | |||
amount= (EditText) findViewById(R.id.amount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above from @yashk2000
@@ -115,7 +116,7 @@ protected Void doInBackground(Void... params) { | |||
*/ | |||
if (jsonObject != null) { | |||
JSONObject user = jsonObject.getJSONObject(getString(R.string.user)); | |||
name = user.getString(getString(R.string.name_)); | |||
name = user.getString(getResources().getString(R.string.fetch_name)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gopikaharikumar is there any need to use getResources()
. Can't you directly call getString()
?
@@ -43,6 +46,8 @@ protected void onCreate(Bundle savedInstanceState) { | |||
poojaType = findViewById(R.id.spinner1); | |||
totalLayout = findViewById(R.id.total_View); | |||
moneyDonated = findViewById(R.id.money_donated); | |||
custompooja = (EditText) findViewById(R.id.custompooja); | |||
amount = (EditText) findViewById(R.id.amount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove typecasting
} | ||
|
||
@Override | ||
public void onNothingSelected(AdapterView<?> adapterView) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a comment or a log statement
app/src/main/res/values/strings.xml
Outdated
@@ -57,12 +57,16 @@ | |||
<string name="update_the_details_of_donated_money">Update The Details Of Donated Money</string> | |||
<string name="update">Update</string> | |||
<string name="error_notSelected">Please select any option</string> | |||
<string name="fetch_name">name</string> | |||
<string name="insert_data">InsertData</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Insert Data" or "InsertData"
4fd2c54
to
23ea34b
Compare
name = nameET.getText().toString(); | ||
if (id.length() == 3) { | ||
uid1ET.setError(getString(R.string.valid_ID)); | ||
} else { | ||
if (flag == 1) { | ||
poojaTyp = String.valueOf(poojaType.getSelectedItem()); | ||
if (sp.contentEquals("Custom Pooja")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you check by using string array instead of "Custom Pooja" because it is hardcoded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gopikaharikumar good job. Thanks 😄
Fixes issue #11