Skip to content

Commit

Permalink
v0.1 [merged-all except database]
Browse files Browse the repository at this point in the history
  • Loading branch information
karakasis committed Apr 23, 2018
1 parent f550c9f commit 7be5b37
Show file tree
Hide file tree
Showing 18 changed files with 594 additions and 120 deletions.
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.NoActionBar">
<activity
android:name=".MainMenu">
android:name=".main_menu.MainMenu">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand All @@ -28,6 +28,7 @@
tools:replace="screenOrientation" />

<activity android:name=".BookInfoActivity"/>
<activity android:name=".gallery.GalleryBackend"/>

</application>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,13 @@ protected void onCreate(Bundle savedInstanceState) {

//Intent intent = getIntent();
Bundle data = getIntent().getExtras();
int position = data.getInt("bookObjectPos");
currentBook = Bookshelf.getInstance().getSingleBook(position);
if(data.containsKey("gallery")){
currentBook = (Book) data.getParcelable("gallery");
}else{
int position = data.getInt("bookObjectPos");
currentBook = Bookshelf.getInstance().getSingleBook(position);
}


String googleID = currentBook.getGoogleID();
String id = currentBook.getId();
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/com/example/xrhstos/bookapp/Bookshelf.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.example.xrhstos.bookapp;

import java.io.Serializable;
import com.example.xrhstos.bookapp.main_menu.MainMenu;
import java.util.ArrayList;
import java.util.HashMap;

/**
* Created by philip on 12/4/2018.
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/java/com/example/xrhstos/bookapp/Collection.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ public Book removeBook(){

//returns the list of the book objects
public ArrayList<Book> getBooks(){
ArrayList<Book> retur = new ArrayList<>();
retur.addAll(bookMap.values());
return new ArrayList<>(retur);
books = new ArrayList<>();
books.addAll(bookMap.values());
return new ArrayList<>(books);//mporei na exei error itan i retur

}

//returns the book in the asked position -- not working probably
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser)
myDb = new DatabaseHelper(this);
}

@Override
public boolean onCreateOptionsMenu(Menu menu){
getMenuInflater().inflate(R.menu.menu, menu);
return true;
}

/**
* This method adds a row to the database
* If row already exists catches exception and shows "ALREADY ADDED"
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/com/example/xrhstos/bookapp/MyApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import android.app.Application;
import android.content.Context;
import com.example.xrhstos.bookapp.gallery.GalleryBackend;
import com.example.xrhstos.bookapp.main_menu.MainMenu;

/**
* Created by Xrhstos on 4/19/2018.
Expand All @@ -10,6 +12,7 @@
public class MyApp extends Application {
private static MyApp instance;
public MainMenu mainMenu;
public GalleryBackend galleryBackend;

public static MyApp getInstance() {
return instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import android.content.ContextWrapper;
import android.graphics.Bitmap;
import android.net.Uri;
import android.view.MenuItem;
import android.widget.ImageView.ScaleType;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkError;
Expand All @@ -22,6 +21,7 @@
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import com.example.xrhstos.bookapp.main_menu.MainMenu;
import com.example.xrhstos.bookapp.parsers.JsonIDParser;
import com.example.xrhstos.bookapp.parsers.JsonParser;
import com.example.xrhstos.bookapp.parsers.XmlParser;
Expand Down Expand Up @@ -128,7 +128,6 @@ public void onErrorResponse(VolleyError volleyError) {
});
}

//good reads request by id in VolleyNetworkingBookInfo class

public StringRequest goodReadsRequestByISBN(final String queryISBNString) {

Expand Down Expand Up @@ -258,7 +257,6 @@ public void onErrorResponse(VolleyError volleyError) {

}

//google request by id in VolleyNetworkingBookInfo class

public JsonObjectRequest googleRequestByISBN(final String queryISBNString) {

Expand Down

This file was deleted.

Loading

0 comments on commit 7be5b37

Please sign in to comment.