mirror of
https://github.com/hmalik144/DaysLeft.git
synced 2026-01-31 02:41:45 +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.LinearLayout;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import android.widget.ProgressBar;
|
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.AbnListAdapter;
|
||||||
import com.appttude.h_mal.days_left.Abn.AbnObject;
|
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>{
|
public class SearchAsyncTask extends AsyncTask<URL,Void,String>{
|
||||||
|
|
||||||
private Activity activity;
|
private Activity activity;
|
||||||
|
|
||||||
private ListView listView;
|
private ListView listView;
|
||||||
private LinearLayout linearLayout;
|
private LinearLayout linearLayout;
|
||||||
private ProgressBar progressBar;
|
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) {
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
AbnObject currentAbnObject = abnObjectArrayList.get(position);
|
AbnObject currentAbnObject = abnObjectArrayList.get(position);
|
||||||
|
|
||||||
|
Toast.makeText(activity, "AHHHHHHH", Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
final Intent returnIntent = new Intent();
|
final Intent returnIntent = new Intent();
|
||||||
returnIntent.putExtra("AbnObject",currentAbnObject);
|
returnIntent.putExtra("AbnObject",currentAbnObject);
|
||||||
new FirebaseClass().newAbnEntry(currentAbnObject.getAbn(), new FirebaseClass.matchListener() {
|
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) {
|
public void abnMatch(Boolean confirm) {
|
||||||
if (!confirm){
|
if (!confirm){
|
||||||
//push to server
|
//push to server
|
||||||
|
activity.setResult(Activity.RESULT_OK,returnIntent);
|
||||||
|
activity.finish();
|
||||||
}else {
|
}else {
|
||||||
activity.setResult(Activity.RESULT_OK,returnIntent);
|
activity.setResult(Activity.RESULT_OK,returnIntent);
|
||||||
activity.finish();
|
activity.finish();
|
||||||
|
|||||||
@@ -153,28 +153,28 @@ public class FirebaseClass {
|
|||||||
if (retrievedAbn != null){
|
if (retrievedAbn != null){
|
||||||
abnObject.setCompanyName(retrievedAbn.getCompanyName());
|
abnObject.setCompanyName(retrievedAbn.getCompanyName());
|
||||||
}
|
}
|
||||||
pushRef.child(abnObject.getAbn()).setValue(abnObject)
|
// pushRef.child(abnObject.getAbn()).setValue(abnObject)
|
||||||
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
// .addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||||
@Override
|
// @Override
|
||||||
public void onComplete(@NonNull Task<Void> task) {
|
// public void onComplete(@NonNull Task<Void> task) {
|
||||||
if (task.isSuccessful()){
|
// if (task.isSuccessful()){
|
||||||
PushTaskObject(abnObject.getAbn(), taskObject, new Complete() {
|
// PushTaskObject(abnObject.getAbn(), taskObject, new Complete() {
|
||||||
@Override
|
// @Override
|
||||||
public void taskCompleted(Boolean success) {
|
// public void taskCompleted(Boolean success) {
|
||||||
if (success){
|
// if (success){
|
||||||
activity.finish();
|
// activity.finish();
|
||||||
}else {
|
// }else {
|
||||||
progressBar.setVisibility(View.GONE);
|
// progressBar.setVisibility(View.GONE);
|
||||||
Toast.makeText(activity, "Could not upload Task", Toast.LENGTH_SHORT).show();
|
// Toast.makeText(activity, "Could not upload Task", Toast.LENGTH_SHORT).show();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}else {
|
// }else {
|
||||||
Log.i(TAG, "onComplete: " + task.getResult());
|
// Log.i(TAG, "onComplete: " + task.getResult());
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user