Skip to content

Commit

Permalink
Added recents option from all files
Browse files Browse the repository at this point in the history
  • Loading branch information
jainakshansh committed Mar 3, 2018
1 parent 512c3d3 commit 4cc9ff9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
Binary file added app/release/PDFReader V1.0 (Release).apk
Binary file not shown.
1 change: 1 addition & 0 deletions app/release/output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1},"path":"app-release.apk","properties":{"packageId":"com.madhouseapps.pdfreader","split":"","minSdkVersion":"21"}}]
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ protected void onCreate(Bundle savedInstanceState) {
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
Intent intent = new Intent(getApplicationContext(), ReadingActivity.class);
Intent intent = new Intent(getApplicationContext(), MainActivity.class);
intent.putExtra("fileUri", fileInfoList.get(i).getUri());
intent.putExtra("fileTitle", fileInfoList.get(i).getName());
startActivity(intent);
}
});
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/java/com/madhouseapps/pdfreader/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,19 @@ public void onClick(View view) {
});

recentFiles(null, null);

/*
Handling the intent from the AllFiles to store the recent values and sending user ahead to the Reading Activity.
*/
Intent intent = getIntent();
if (intent.getExtras() != null) {
String uri = intent.getStringExtra("fileUri");
String title = intent.getStringExtra("fileTitle");
recentFiles(Uri.parse(uri), title);
Intent readIntent = new Intent(getApplicationContext(), ReadingActivity.class);
readIntent.putExtra("fileUri", uri);
startActivity(readIntent);
}
}

private void render() {
Expand Down

0 comments on commit 4cc9ff9

Please sign in to comment.