Commit 1ec78012 authored by jake.ejraee's avatar jake.ejraee

Update homeScreen.java

parent 3d12ed9b
...@@ -2,13 +2,20 @@ package com.example.soulfood_assignment2; ...@@ -2,13 +2,20 @@ package com.example.soulfood_assignment2;
import android.animation.ObjectAnimator; import android.animation.ObjectAnimator;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v4.view.ViewCompat; import android.support.v4.view.ViewCompat;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.widget.Button; import android.widget.Button;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
public class homeScreen extends AppCompatActivity { public class homeScreen extends AppCompatActivity {
int swipeStartX; int swipeStartX;
...@@ -23,9 +30,13 @@ public class homeScreen extends AppCompatActivity { ...@@ -23,9 +30,13 @@ public class homeScreen extends AppCompatActivity {
sideView = this.findViewById(R.id.sideView); sideView = this.findViewById(R.id.sideView);
settingsButton = this.findViewById(R.id.buttonSettings); settingsButton = this.findViewById(R.id.buttonSettings);
ViewCompat.setTranslationZ(sideView, 20f); //bring sideView in front of buttons ViewCompat.setTranslationZ(sideView, 20f); //bring sideView in front of buttons
Button b = (Button)findViewById(R.id.suggestButton); SharedPreferences saves = getApplicationContext().getSharedPreferences("Saves", 0);
b.setOnClickListener(new Listener()); if(!saves.contains("saves")){
SharedPreferences.Editor e = saves.edit();
e.putStringSet("saves", new HashSet<String>());
e.commit();
}
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment