Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

feat: Added option for Custom Pooja and Amount paid #65

Merged
merged 2 commits into from
Jul 2, 2019

Conversation

gopikaharikumar
Copy link
Contributor

Fixes issue #11

  • Added an option for Custom Pooja in the App
  • Added an option to enter the Amount paid for a Pooja

@ajay-prabhakar
Copy link
Member

ajay-prabhakar commented Jul 1, 2019

@gopikaharikumar your build is failing because of spotless Just run ./gradlew spotlessApply it will automatically detects your errors and it will change them

@@ -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]);
Copy link
Member

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

Copy link
Member

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

@yashk2000 yashk2000 changed the title Added option for Custom Pooja and Amount paid feat: Added option for Custom Pooja and Amount paid Jul 1, 2019
@@ -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);
Copy link
Member

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);
Copy link
Member

Choose a reason for hiding this comment

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

Redundant type casts.

@yashk2000
Copy link
Member

@gopikaharikumar always follow Semantic Pull Request format while sending a pr, please.
Also before sending a pr, do run ./gradlew spotlessApply to detect any code formatting errors and fix them.

@@ -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");
Copy link
Member

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);
Copy link
Member

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));
Copy link
Member

@yashk2000 yashk2000 Jul 2, 2019

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);
Copy link
Member

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) {}
Copy link
Member

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

@@ -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>
Copy link
Member

Choose a reason for hiding this comment

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

"Insert Data" or "InsertData"

@immadisairaj immadisairaj self-requested a review July 2, 2019 07:47
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")) {
Copy link
Member

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.

Copy link
Member

@yashk2000 yashk2000 left a 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 😄

@immadisairaj immadisairaj merged commit 9975ddf into amfoss:development Jul 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants