Skip to content
This repository was archived by the owner on Nov 8, 2018. It is now read-only.

Commit a38143b

Browse files
removed extra spacing
1 parent 86cfa63 commit a38143b

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

malaria-app-android/src/main/java/com/peacecorps/malaria/ui/medicine_store/MedicineStoreFragment.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,8 @@ public void onClick(View view) {
154154
quantity.requestFocus();
155155
} else {
156156
//Entered Order quantity is greater than 0
157-
158157
if (ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.SEND_SMS)
159158
!= PackageManager.PERMISSION_GRANTED) {
160-
161159
// Permission is not granted
162160
// Ask for permission
163161
ActivityCompat.requestPermissions(getActivity(),
@@ -172,24 +170,19 @@ public void onClick(View view) {
172170
if(smsPermissionGranted) {
173171
SmsManager smsManager = SmsManager.getDefault();
174172
//Sms cannot parse html tags so remove them and use appropriate alternative
175-
176173
String message = (presenter.getMessageBodyForOrder() +Integer.parseInt(quantity.getText().toString())).toString();
177174
String patternRegex = "<[/]*b>"; // To match <b> and </b>
178175
message = message.replaceAll("<br>","\n");
179176
message = message.replaceAll(patternRegex," ");
180177
String phoneNo = "121";
181178
smsManager.sendTextMessage(phoneNo, null,message, null, null);
182-
183179
Toast.makeText(getActivity(), "Message sent", Toast.LENGTH_LONG).show();
184180
orderMedicineDialog.dismiss();
185-
186181
}
187182
else{
188183
//Show Toast message
189184
Toast.makeText(getActivity(), "Cannot use this feature without Send SMS permission", Toast.LENGTH_LONG).show();
190185
}
191-
192-
193186
}
194187
}
195188
});
@@ -255,8 +248,7 @@ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permis
255248
{
256249
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
257250

258-
if (requestCode == PERMISSIONS_REQUEST_SEND_SMS && grantResults.length >0 && grantResults[0] == PackageManager.PERMISSION_GRANTED )
259-
{
251+
if (requestCode == PERMISSIONS_REQUEST_SEND_SMS && grantResults.length >0 && grantResults[0] == PackageManager.PERMISSION_GRANTED ) {
260252
smsPermissionGranted = true;
261253
}
262254
}

0 commit comments

Comments
 (0)