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

Commit

Permalink
Merge pull request #89 from AnoopkRajan/development
Browse files Browse the repository at this point in the history
fix: Toast Duration
  • Loading branch information
vchrombie authored Jul 31, 2019
2 parents 13dd8b5 + 6af205d commit 2345475
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 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();
}
}
}

0 comments on commit 2345475

Please sign in to comment.