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

Commit

Permalink
Fixed the Toast duration
Browse files Browse the repository at this point in the history
Fix Travis build

Update DeleteData.java

Update InsertData.java

Update ReadAllData.java

Update ReadSingleData.java

Update UpdateData.java

intented

Refix gradle build

Modified Requested Changes

removed

deleted code

fix: Scroll functionality enabled (#88)

complete changes

gradle revert

Reduced Toast Duration

Update pull_request_template.md

Update pull_request_template.md

Update pull_request_template.md

Update pull_request_template.md
  • Loading branch information
AnoopkRajan committed Jul 19, 2019
1 parent 579bc37 commit 42ba927
Show file tree
Hide file tree
Showing 9 changed files with 168 additions and 149 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ public void radioGroupOnCheckedChanged(RadioGroup group, int checkedId) {
case R.id.radio_donate:
binding.totalView.setVisibility(View.VISIBLE);
flag = 0;
Toast.makeText(getBaseContext(), getString(R.string.delete_donated), Toast.LENGTH_LONG)
Toast.makeText(getBaseContext(), getString(R.string.delete_donated), Toast.LENGTH_SHORT)
.show();
break;
case R.id.radio_pooja:
binding.totalView.setVisibility(View.VISIBLE);
flag = 1;
Toast.makeText(getBaseContext(), getString(R.string.delete_pooja), Toast.LENGTH_LONG)
Toast.makeText(getBaseContext(), getString(R.string.delete_pooja), Toast.LENGTH_SHORT)
.show();
break;
}
Expand Down Expand Up @@ -93,7 +93,7 @@ protected Void doInBackground(Void... params) {
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
dialog.dismiss();
Toast.makeText(getApplicationContext(), result, Toast.LENGTH_LONG).show();
Toast.makeText(getBaseContext(), result, Toast.LENGTH_SHORT).show();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void onCheckedChanged(RadioGroup group, int checkedId) {
insertDataBinding.amount.setVisibility(View.GONE);
id = getResources().getString(R.string.DON);
flag = 0;
Toast.makeText(getBaseContext(), getString(R.string.selected_donate), Toast.LENGTH_LONG)
Toast.makeText(getBaseContext(), getString(R.string.selected_donate), Toast.LENGTH_SHORT)
.show();
break;

Expand All @@ -93,7 +93,8 @@ public void onCheckedChanged(RadioGroup group, int checkedId) {
insertDataBinding.spinner1.setVisibility(View.VISIBLE);
id = getString(R.string.REG);
flag = 1;
Toast.makeText(getBaseContext(), getString(R.string.selected_register), Toast.LENGTH_LONG)
Toast.makeText(
getBaseContext(), getString(R.string.selected_register), Toast.LENGTH_SHORT)
.show();
break;
}
Expand Down Expand Up @@ -161,7 +162,7 @@ protected Void doInBackground(Void... params) {
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
dialog.dismiss();
Toast.makeText(getApplicationContext(), result, Toast.LENGTH_LONG).show();
Toast.makeText(getBaseContext(), result, Toast.LENGTH_SHORT).show();
}
}
}
20 changes: 10 additions & 10 deletions app/src/main/java/org/amfoss/templeapp/activities/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,44 +49,44 @@ public void onClick(DialogInterface dialog, int id) {

public class Presenter {
public void onInsertClick(View view) {
if (InternetConnection.checkConnection(getApplicationContext())) {
Intent intent = new Intent(getApplicationContext(), InsertData.class);
if (InternetConnection.checkConnection(getBaseContext())) {
Intent intent = new Intent(getBaseContext(), InsertData.class);
startActivity(intent);
} else {
createNetErrorDialog();
}
}

public void onReadAllClick(View view) {
if (InternetConnection.checkConnection(getApplicationContext())) {
Intent intent = new Intent(getApplicationContext(), ReadAllData.class);
if (InternetConnection.checkConnection(getBaseContext())) {
Intent intent = new Intent(getBaseContext(), ReadAllData.class);
startActivity(intent);
} else {
createNetErrorDialog();
}
}

public void onUpdateClick(View view) {
if (InternetConnection.checkConnection(getApplicationContext())) {
Intent intent = new Intent(getApplicationContext(), UpdateData.class);
if (InternetConnection.checkConnection(getBaseContext())) {
Intent intent = new Intent(getBaseContext(), UpdateData.class);
startActivity(intent);
} else {
createNetErrorDialog();
}
}

public void onReadSingleData(View view) {
if (InternetConnection.checkConnection(getApplicationContext())) {
Intent intent = new Intent(getApplicationContext(), ReadSingleData.class);
if (InternetConnection.checkConnection(getBaseContext())) {
Intent intent = new Intent(getBaseContext(), ReadSingleData.class);
startActivity(intent);
} else {
createNetErrorDialog();
}
}

public void onDeleteClick(View view) {
if (InternetConnection.checkConnection(getApplicationContext())) {
Intent intent = new Intent(getApplicationContext(), DeleteData.class);
if (InternetConnection.checkConnection(getBaseContext())) {
Intent intent = new Intent(getBaseContext(), DeleteData.class);
startActivity(intent);
} else {
createNetErrorDialog();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ public void readAllButton(View view) {
|| readAllBinding.poojaNotPaid.isChecked()
|| readAllBinding.donatePaid.isChecked()
|| readAllBinding.donateNotPaid.isChecked())) {
Toast.makeText(
getApplicationContext(), getString(R.string.error_notSelected), Toast.LENGTH_LONG)
Toast.makeText(getBaseContext(), getString(R.string.error_notSelected), Toast.LENGTH_SHORT)
.show();
} else {
new ReadData1().execute();
Expand Down Expand Up @@ -220,8 +219,7 @@ protected void onPostExecute(Void aVoid) {
readAllBinding.heading.setVisibility(TextView.VISIBLE);

} else {
Toast.makeText(getApplicationContext(), getString(R.string.no_data), Toast.LENGTH_LONG)
.show();
Toast.makeText(getBaseContext(), getString(R.string.no_data), Toast.LENGTH_SHORT).show();
readAllBinding.heading.setVisibility(TextView.INVISIBLE);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,14 @@ public void radioGroup(RadioGroup group, int checkedId) {
case R.id.radio_donate:
binding.totalView.setVisibility(View.VISIBLE);
flag = 0;
Toast.makeText(getBaseContext(), getString(R.string.selected_donate), Toast.LENGTH_LONG)
Toast.makeText(getBaseContext(), getString(R.string.selected_donate), Toast.LENGTH_SHORT)
.show();
break;
case R.id.radio_pooja:
binding.totalView.setVisibility(View.VISIBLE);
flag = 1;
Toast.makeText(getBaseContext(), getString(R.string.selected_register), Toast.LENGTH_LONG)
Toast.makeText(
getBaseContext(), getString(R.string.selected_register), Toast.LENGTH_SHORT)
.show();
break;
}
Expand Down Expand Up @@ -134,7 +135,7 @@ protected void onPostExecute(Void aVoid) {
binding.paidL.setText(getString(R.string.paid_status));

} else
Toast.makeText(getApplicationContext(), getString(R.string.id_not_found), Toast.LENGTH_LONG)
Toast.makeText(getBaseContext(), getString(R.string.id_not_found), Toast.LENGTH_SHORT)
.show();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void onCheckedChanged(RadioGroup group, int checkedId) {
binding.moneyDonated.setVisibility(View.VISIBLE);
id = getString(R.string.DON);
flag = 0;
Toast.makeText(getBaseContext(), getString(R.string.UPDATE), Toast.LENGTH_LONG).show();
Toast.makeText(getBaseContext(), getString(R.string.UPDATE), Toast.LENGTH_SHORT).show();
break;
case R.id.radio_pooja:
binding.totalView.setVisibility(View.VISIBLE);
Expand All @@ -92,7 +92,7 @@ public void onCheckedChanged(RadioGroup group, int checkedId) {
binding.amount.setVisibility(View.VISIBLE);
id = getString(R.string.REG);
flag = 1;
Toast.makeText(getBaseContext(), getString(R.string.update_pooja), Toast.LENGTH_LONG)
Toast.makeText(getBaseContext(), getString(R.string.update_pooja), Toast.LENGTH_SHORT)
.show();
break;
}
Expand Down Expand Up @@ -152,7 +152,7 @@ protected Void doInBackground(Void... params) {
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
dialog.dismiss();
Toast.makeText(getApplicationContext(), result, Toast.LENGTH_LONG).show();
Toast.makeText(getBaseContext(), result, Toast.LENGTH_SHORT).show();
}
}
}
Loading

0 comments on commit 42ba927

Please sign in to comment.