Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

Commit

Permalink
A bunch of stuff fixed and added
Browse files Browse the repository at this point in the history
  • Loading branch information
javacafe01 committed Feb 26, 2018
1 parent 769b14b commit 1b93e5f
Show file tree
Hide file tree
Showing 31 changed files with 420 additions and 56 deletions.
11 changes: 9 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ android {
applicationId "com.gsnathan.pdfviewer"
minSdkVersion 19
targetSdkVersion 26
versionCode 5
versionName "1.4"
versionCode 6
versionName "1.5"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true

javaCompileOptions {
annotationProcessorOptions {
Expand All @@ -33,6 +34,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
Expand All @@ -59,5 +61,10 @@ dependencies {
//View for App Licence
compile 'com.jgabrielfreitas:licensetextview:1.1.2'

//Material About Page Library
compile 'com.github.jrvansuita:MaterialAbout:0.2.0'

//Changelog Library
compile 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0'

}
Binary file modified app/release/app-release.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion app/release/output.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":5},"path":"app-release.apk","properties":{"packageId":"com.gsnathan.pdfviewer","split":"","minSdkVersion":"19"}}]
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":6},"path":"app-release.apk","properties":{"packageId":"com.gsnathan.pdfviewer","split":"","minSdkVersion":"19"}}]
18 changes: 16 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<activity
android:name=".PrivacyActivity"
android:label="Privacy Policy"
android:parentActivityName=".AboutActivity"
android:parentActivityName=".MaterialAboutActivity"
android:theme="@style/AppTheme">

<!-- The meta-data tag is required if you support API level 15 and lower -->
Expand All @@ -98,7 +98,7 @@
<activity
android:name=".LicenseActivity"
android:label="License"
android:parentActivityName=".AboutActivity"
android:parentActivityName=".MaterialAboutActivity"
android:theme="@style/AppTheme">

<!-- The meta-data tag is required if you support API level 15 and lower -->
Expand All @@ -107,6 +107,20 @@
android:value=".AboutActivity" />
</activity>

<!-- Material About -->
<activity
android:name=".MaterialAboutActivity"
android:label="About"
android:theme="@style/AppThemeCustom"
android:parentActivityName=".MainActivity">

<!-- The meta-data tag is required if you support API level 15 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />

</activity>

</application>

</manifest>
64 changes: 42 additions & 22 deletions app/src/main/java/com/gsnathan/pdfviewer/AboutActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.support.annotation.NonNull;

import com.danielstone.materialaboutlibrary.MaterialAboutActivity;
Expand All @@ -20,6 +19,9 @@

/**
* Created by Gokul Swaminathan on 2/22/2018.
*
* NOT IN USE
*
*/

public class AboutActivity extends MaterialAboutActivity {
Expand Down Expand Up @@ -48,7 +50,7 @@ private void buildApp(MaterialAboutCard.Builder appBuilder, final Context contex
.icon(R.mipmap.ic_launcher)
.build());
appBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("Version " + BuildConfig.VERSION_NAME)
.text("Version " + Utils.getAppVersion())
.icon(R.drawable.info_outline)
.build());
appBuilder.addItem(new MaterialAboutActionItem.Builder()
Expand All @@ -57,7 +59,18 @@ private void buildApp(MaterialAboutCard.Builder appBuilder, final Context contex
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
startActivity(new Intent(getApplicationContext(), MainIntroActivity.class));
startActivity(Utils.navIntent(getApplicationContext(), MainIntroActivity.class));
}
})
.build());
appBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.appChangelog)
.icon(R.drawable.clipboard_alert)
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
LogFragment log = new LogFragment();
log.show(getSupportFragmentManager(), "Log Fragment");
}
})
.build());
Expand All @@ -67,7 +80,7 @@ public void onClick() {
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
startActivity(new Intent(getApplicationContext(), LicenseActivity.class));
startActivity(Utils.navIntent(getApplicationContext(), LicenseActivity.class));
}
})
.build());
Expand All @@ -77,7 +90,7 @@ public void onClick() {
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
startActivity(new Intent(getApplicationContext(), PrivacyActivity.class));
startActivity(Utils.navIntent(getApplicationContext(), PrivacyActivity.class));
}
})
.build());
Expand All @@ -92,7 +105,7 @@ private void buildAuthor(MaterialAboutCard.Builder appBuilder, final Context con
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/JavaCafe01")));
startActivity(Utils.linkIntent("https://github.com/JavaCafe01"));
}
})
.build());
Expand Down Expand Up @@ -127,7 +140,7 @@ private void buildOpenLicenses(MaterialAboutCard.Builder appBuilder, final Conte
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/JavaCafe01/PdfViewer")));
startActivity(Utils.linkIntent("https://github.com/JavaCafe01/PdfViewer"));
}
})
.build());
Expand All @@ -137,17 +150,17 @@ public void onClick() {
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
showLibs();
showLibs();
}
})
.build());
appBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.icon)
.icon(R.drawable.favicon)
.icon(R.drawable.favicon_black)
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://materialdesignicons.com/")));
startActivity(Utils.linkIntent("https://materialdesignicons.com/"));
}
})
.build());
Expand All @@ -161,7 +174,7 @@ private void buildRateAndReview(MaterialAboutCard.Builder appBuilder, final Cont
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=com.gsnathan.pdfviewer")));
startActivity(Utils.linkIntent("http://play.google.com/store/apps/details?id=com.gsnathan.pdfviewer"));
}
})
.build());
Expand All @@ -171,22 +184,12 @@ public void onClick() {
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
showReviewPage();
startActivity(Utils.emailIntent(EMAIL,"Pdf Viewer Plus Review", Utils.getAndroidVersion() + "\n\nFeedback:\n", "Send Feedback:"));
}
})
.build());
}

private void showReviewPage()
{
Intent Email = new Intent(Intent.ACTION_SEND);
Email.setType("text/email");
Email.putExtra(Intent.EXTRA_EMAIL, new String[] { "[email protected]" });
Email.putExtra(Intent.EXTRA_SUBJECT, "Pdf Viewer Plus Review");
Email.putExtra(Intent.EXTRA_TEXT, Utils.getAndroidVersion() + "\n\nFeedback:\n");
startActivity(Intent.createChooser(Email, "Send Feedback:"));
}

private void showLibs()
{
AttributionPresenter attributionPresenter = new AttributionPresenter.Builder(this)
Expand Down Expand Up @@ -261,12 +264,29 @@ private void showLibs()
.setWebsite("https://github.com/webianks/EasyFeedback")
.build()
)
.addAttributions(
new Attribution.Builder("Material About")
.addCopyrightNotice("Copyright 2016 Arleu Cezar Vansuita Júnior")
.addLicense(License.MIT)
.setWebsite("https://github.com/jrvansuita/MaterialAbout")
.build()
)
.addAttributions(
new Attribution.Builder("ChangeLog Library")
.addCopyrightNotice("Copyright 2013-2015 Gabriele Mariotti")
.addLicense(License.APACHE)
.setWebsite("https://github.com/gabrielemariotti/changeloglib")
.build()
)
.build();

//show license dialogue
attributionPresenter.showDialog("Open Source Libraries");
}




@Override
protected CharSequence getActivityTitle() {
return getString(R.string.action_about);
Expand Down
40 changes: 40 additions & 0 deletions app/src/main/java/com/gsnathan/pdfviewer/LogFragment.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.gsnathan.pdfviewer;

import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;

import it.gmariotti.changelibs.library.view.ChangeLogRecyclerView;

/**
* Created by Gokul Swaminathan on 2/25/2018.
*/

public class LogFragment extends DialogFragment {

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
LayoutInflater layoutInflater = (LayoutInflater) getActivity().getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
ChangeLogRecyclerView chgList= (ChangeLogRecyclerView) layoutInflater.inflate(R.layout.fragment_log, null);


return new AlertDialog.Builder(getActivity(),R.style.AppCompatAlertDialogStyle)
.setTitle(R.string.appChangelog)
.setView(chgList)
.setPositiveButton(R.string.ok,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
dialog.dismiss();
}
}
)
.create();

}

}
3 changes: 1 addition & 2 deletions app/src/main/java/com/gsnathan/pdfviewer/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,7 @@ public boolean onCreateOptionsMenu(Menu menu) {
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_about:
Intent intent = new Intent(this, AboutActivity.class);
startActivity(intent);
startActivity(Utils.navIntent(this, MaterialAboutActivity.class));
return true;
default:
return super.onOptionsItemSelected(item);
Expand Down
Loading

0 comments on commit 1b93e5f

Please sign in to comment.