Skip to content

Commit

Permalink
Bug Fixed:
Browse files Browse the repository at this point in the history
 Image won't refresh when dragging it to the "yuck" bar. Currently working on it.

 Known bugs:

 Items in database still being overwritten even if they already exist in the database. Disabled write authority for now until we can fix this.
  • Loading branch information
Remixt committed Dec 5, 2016
1 parent b742ed7 commit acc88af
Showing 1 changed file with 24 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import android.view.View;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;

import com.google.android.gms.appindexing.Action;
import com.google.android.gms.appindexing.AppIndex;
Expand All @@ -24,7 +23,6 @@
import com.smileyface.tastr.Other.TastrItem;
import com.smileyface.tastr.R;
import com.smileyface.tastr.Utilities.CallHandler;
import com.smileyface.tastr.Utilities.DownloadImageTask;
import com.smileyface.tastr.Utilities.ItemLoader;
import com.smileyface.tastr.Utilities.LocationHandler;
import com.smileyface.tastr.Utilities.YelpDataExecutor;
Expand All @@ -34,17 +32,17 @@


public class TouchActivity extends Activity {
private String msg;
private String msg = "Drag Listener";
private ProgressBar loadSpinner;
private RelativeLayout.LayoutParams layoutParams;
//private RelativeLayout.LayoutParams layoutParams;
final static private int minHeight = 500;
final static private int minWidth = 600;
YelpDataExecutor yelp = new YelpDataExecutor();
LocationHandler curLoc = new LocationHandler(this);


private GoogleApiClient client;
private DownloadImageTask imageLoader;
//private DownloadImageTask imageLoader;
ItemLoader itemLoader;
TastrItem currentItem;

Expand All @@ -54,6 +52,20 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_touch);
loadSpinner = (ProgressBar) findViewById(R.id.loadingSpinner);
client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
curLoc.askForlocation();
yelp.execute(curLoc.getCurrentLat(), curLoc.getCurrentLong());
itemLoader = new ItemLoader(yelp);
itemLoader.execute();

// Instantiate background process, connect to firebase and fill the Tastr Item queue

// Wait for an item to be added before trying to load an image into the gui.
TastrSync sync = new TastrSync();
sync.execute();
// ATTENTION: This was auto-generated to implement the App Indexing API.
// See https://g.co/AppIndexing/AndroidStudio for more information.
client.connect();
AppIndex.AppIndexApi.start(client, getIndexApiAction());

}

Expand Down Expand Up @@ -125,7 +137,6 @@ public boolean onDrag(View v, DragEvent event) {
case DragEvent.ACTION_DROP:
showNextImage();
v.setVisibility(View.VISIBLE);
onCreate(null);
Log.d(msg, "Drag ended");
if (dropEventNotHandled(event)) {
v.setVisibility(View.VISIBLE);
Expand Down Expand Up @@ -172,9 +183,9 @@ private boolean dropEventNotHandled(DragEvent dragEvent) {

private Action getIndexApiAction() {
Thing object = new Thing.Builder()
.setName("Touch Page") // TODO: Define a title for the content shown.
.setName("Touch Activity") // TODO: Define a title for the content shown.
// TODO: Make sure this auto-generated URL is correct.
.setUrl(Uri.parse("http://[ENTER-YOUR-URL-HERE]"))
.setUrl(Uri.parse("https://console.firebase.google.com/project/unt-team-project/overview"))
.build();
return new Action.Builder(Action.TYPE_VIEW)
.setObject(object)
Expand All @@ -185,20 +196,6 @@ private Action getIndexApiAction() {
@Override
public void onStart() {
super.onStart();
curLoc.askForlocation();
yelp.execute(curLoc.getCurrentLat(), curLoc.getCurrentLong());
itemLoader = new ItemLoader(yelp);
itemLoader.execute();

// Instantiate background process, connect to firebase and fill the Tastr Item queue

// Wait for an item to be added before trying to load an image into the gui.
TastrSync sync = new TastrSync();
sync.execute();
// ATTENTION: This was auto-generated to implement the App Indexing API.
// See https://g.co/AppIndexing/AndroidStudio for more information.
client.connect();
AppIndex.AppIndexApi.start(client, getIndexApiAction());
}

int totalItems = 0;
Expand Down Expand Up @@ -249,6 +246,11 @@ public void onStop() {
client.disconnect();
}

@Override
public void onResume() {
super.onResume();
}

public void getCurrentTastrItem() {

}
Expand Down

0 comments on commit acc88af

Please sign in to comment.