Skip to content

Commit

Permalink
add library notifcation
Browse files Browse the repository at this point in the history
  • Loading branch information
pswiatowski committed Nov 16, 2014
1 parent a274162 commit 1baec61
Show file tree
Hide file tree
Showing 34 changed files with 1,844 additions and 70 deletions.
23 changes: 23 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,30 @@
package="swiatowski.piotr.bibliotekapwr" >

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<receiver android:name=".services.ConnectivityChangeReceiver">
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
</intent-filter>
</receiver>
<receiver android:name=".widget.MyWidgetProvider" >
<intent-filter >
<action
android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>

<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/search_widget" />
</receiver>
<activity
android:name=".SplashActivity"
android:label="@string/app_name" >
Expand All @@ -25,6 +43,11 @@
<activity android:name=".ISBNActivity" />
<activity android:name=".RentInfoActivity" />
<activity android:name=".BookInfoActivity" />
<activity android:name=".RentActivity" />
<activity android:name=".MyBookActivity" />
<activity android:name=".NotificationListActivity" />
<activity android:name=".LibraryInfoActivity" />
<activity android:name=".LibraryListActivity" />

</application>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

/**
* Created by Piotrek on 2014-11-02.
*
*/
@ContentView(R.layout.activity_book_info)
public class BookInfoActivity extends RoboActivity {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

/**
* Created by Piotrek on 2014-11-02.
*
*/
public class BundleConstants {

public static final String SEARCH_VALUE = "searchValue";
public static final String BOOK_ROW = "booRow";
public static final String SELECTED_ROW = "selectedRow";
public static final String RENT_URL = "rentURl";
public static final String SELECTED_LIBRARY = "libraryInfo";

}
27 changes: 20 additions & 7 deletions app/src/main/java/swiatowski/piotr/bibliotekapwr/ISBNActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

import android.content.Intent;
import android.os.Bundle;
import android.provider.Settings;
import android.util.Log;
import android.view.View;

import roboguice.activity.RoboActivity;
import roboguice.inject.ContentView;

/**
* Created by Piotrek on 2014-11-01.
*
*/
public class ISBNActivity extends RoboActivity {

private void setUpView() {

Intent intent = new Intent("com.google.zxing.client.android.SCAN");
// intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
intent.putExtra("SCAN_MODE", "PRODUCT_MODE");
startActivityForResult(intent, 0);
}
Expand All @@ -34,17 +34,30 @@ protected void onResume() {
}

public void onActivityResult(int requestCode, int resultCode, Intent intent) {
// super.onActivityResult(requestCode, resultCode, intent);
if (requestCode == 0) {
if (resultCode == RESULT_OK) {
String contents = intent.getStringExtra("SCAN_RESULT");

Log.d("doszlos", "znalezione ");
Intent bookListActivity = new Intent(this, BookListActivity.class);
bookListActivity.putExtra(BundleConstants.SEARCH_VALUE, contents);
startActivity(bookListActivity);
} else if (resultCode == RESULT_CANCELED) {
Log.i("App", "Scan unsuccessful");
} else if (resultCode == 0) {
Log.d("doszlos", "Scan unsuccessful");
onBackPressed();
finish();

}
} else {
finish();
}

}

}

@Override
public void onBackPressed() {
super.onBackPressed();
finish();
}
}
Loading

0 comments on commit 1baec61

Please sign in to comment.