mirror of
https://github.com/hmalik144/DaysLeft.git
synced 2025-12-10 03:05:29 +00:00
25/06 version
This commit is contained in:
BIN
.idea/caches/gradle_models.ser
generated
BIN
.idea/caches/gradle_models.ser
generated
Binary file not shown.
@@ -10,6 +10,7 @@ import android.widget.AdapterView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ListView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.appttude.h_mal.days_left.Abn.AbnListAdapter;
|
||||
import com.appttude.h_mal.days_left.Abn.AbnObject;
|
||||
@@ -27,6 +28,7 @@ import static com.appttude.h_mal.days_left.Abn.SearchAbnRecords.makeHttpRequest;
|
||||
public class SearchAsyncTask extends AsyncTask<URL,Void,String>{
|
||||
|
||||
private Activity activity;
|
||||
|
||||
private ListView listView;
|
||||
private LinearLayout linearLayout;
|
||||
private ProgressBar progressBar;
|
||||
@@ -110,6 +112,8 @@ public class SearchAsyncTask extends AsyncTask<URL,Void,String>{
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
AbnObject currentAbnObject = abnObjectArrayList.get(position);
|
||||
|
||||
Toast.makeText(activity, "AHHHHHHH", Toast.LENGTH_SHORT).show();
|
||||
|
||||
final Intent returnIntent = new Intent();
|
||||
returnIntent.putExtra("AbnObject",currentAbnObject);
|
||||
new FirebaseClass().newAbnEntry(currentAbnObject.getAbn(), new FirebaseClass.matchListener() {
|
||||
@@ -117,6 +121,8 @@ public class SearchAsyncTask extends AsyncTask<URL,Void,String>{
|
||||
public void abnMatch(Boolean confirm) {
|
||||
if (!confirm){
|
||||
//push to server
|
||||
activity.setResult(Activity.RESULT_OK,returnIntent);
|
||||
activity.finish();
|
||||
}else {
|
||||
activity.setResult(Activity.RESULT_OK,returnIntent);
|
||||
activity.finish();
|
||||
|
||||
@@ -153,28 +153,28 @@ public class FirebaseClass {
|
||||
if (retrievedAbn != null){
|
||||
abnObject.setCompanyName(retrievedAbn.getCompanyName());
|
||||
}
|
||||
pushRef.child(abnObject.getAbn()).setValue(abnObject)
|
||||
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<Void> task) {
|
||||
if (task.isSuccessful()){
|
||||
PushTaskObject(abnObject.getAbn(), taskObject, new Complete() {
|
||||
@Override
|
||||
public void taskCompleted(Boolean success) {
|
||||
if (success){
|
||||
activity.finish();
|
||||
}else {
|
||||
progressBar.setVisibility(View.GONE);
|
||||
Toast.makeText(activity, "Could not upload Task", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}else {
|
||||
Log.i(TAG, "onComplete: " + task.getResult());
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
// pushRef.child(abnObject.getAbn()).setValue(abnObject)
|
||||
// .addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
// @Override
|
||||
// public void onComplete(@NonNull Task<Void> task) {
|
||||
// if (task.isSuccessful()){
|
||||
// PushTaskObject(abnObject.getAbn(), taskObject, new Complete() {
|
||||
// @Override
|
||||
// public void taskCompleted(Boolean success) {
|
||||
// if (success){
|
||||
// activity.finish();
|
||||
// }else {
|
||||
// progressBar.setVisibility(View.GONE);
|
||||
// Toast.makeText(activity, "Could not upload Task", Toast.LENGTH_SHORT).show();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }else {
|
||||
// Log.i(TAG, "onComplete: " + task.getResult());
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user