This repository has been archived by the owner on Feb 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 65
/
AboutActivity.java
206 lines (186 loc) · 9.34 KB
/
AboutActivity.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
/*
* MIT License
*
* Copyright (c) 2018 Gokul Swaminathan
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.gsnathan.pdfviewer;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.View;
import android.widget.TextView;
import com.franmontiel.attributionpresenter.AttributionPresenter;
import com.franmontiel.attributionpresenter.entities.Attribution;
import com.franmontiel.attributionpresenter.entities.License;
import com.jaredrummler.cyanea.app.CyaneaAppCompatActivity;
import com.jaredrummler.cyanea.prefs.CyaneaSettingsActivity;
import com.jaredrummler.cyanea.prefs.CyaneaThemePickerActivity;
public class AboutActivity extends CyaneaAppCompatActivity {
TextView versionView; //shows the version
private final String APP_VERSION_RELEASE = "Version " + Utils.getAppVersion(); //contains Version + the version number
private final String APP_VERSION_DEBUG = "Version " + Utils.getAppVersion() + "-debug"; //contains Version + the version number + debug
private Toolbar toolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
initUI();
setUpToolBar();
}
private void setUpToolBar() {
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(R.string.app_name);
}
private void initUI() {
//initialize the textview
versionView = (TextView) findViewById(R.id.text_version);
//initialize the toolbar
toolbar = (Toolbar) findViewById(R.id.toolbar_about);
// check if app is debug
if (BuildConfig.DEBUG) {
versionView.setText(APP_VERSION_DEBUG);
} else //if app is release
{
versionView.setText(APP_VERSION_RELEASE);
}
}
public void replayIntro(View v) {
//navigate to intro class (replay the intro)
startActivity(Utils.navIntent(getApplicationContext(), MainIntroActivity.class));
}
public void showLog(View v) {
LogFragment log = new LogFragment();
log.show(getSupportFragmentManager(), "Log Fragment");
}
public void showPrivacy(View v) {
startActivity(Utils.navIntent(getApplicationContext(), PrivacyActivity.class));
}
public void showMaterial(View v) {
startActivity(Utils.linkIntent("https://materialdesignicons.com/"));
}
public void showLicense(View v) {
startActivity(Utils.navIntent(getApplicationContext(), LicenseActivity.class));
}
public void showLibraries(View v) {
AttributionPresenter attributionPresenter = new AttributionPresenter.Builder(this)
.addAttributions(
new Attribution.Builder("AttributionPresenter")
.addCopyrightNotice("Copyright 2017 Francisco José Montiel Navarro")
.addLicense(License.APACHE)
.setWebsite("https://github.com/franmontiel/AttributionPresenter")
.build()
)
.addAttributions(
new Attribution.Builder("Android PdfViewer")
.addCopyrightNotice("Copyright 2017 Bartosz Schiller")
.addLicense(License.APACHE)
.setWebsite("https://github.com/barteksc/AndroidPdfViewer")
.build()
)
.addAttributions(
new Attribution.Builder("AndroidAnnotations")
.addCopyrightNotice("Copyright 2012-2016 eBusiness Information\n" +
"Copyright 2016-2017 the AndroidAnnotations project")
.addLicense(License.APACHE)
.setWebsite("https://github.com/androidannotations/androidannotations")
.build()
)
.addAttributions(
new Attribution.Builder("AppIntro")
.addCopyrightNotice("Copyright 2018 paorotolo")
.addLicense(License.APACHE)
.setWebsite("https://github.com/paolorotolo/AppIntro")
.build()
)
.addAttributions(
new Attribution.Builder("Android Open Source Project")
.addCopyrightNotice("Copyright 2016 The Android Open Source Project")
.addLicense(License.APACHE)
.setWebsite("http://developer.android.com/tools/support-library/index.html")
.build()
)
.addAttributions(
new Attribution.Builder("Android Support Libraries")
.addCopyrightNotice("Copyright 2016 The Android Open Source Project")
.addLicense(License.APACHE)
.setWebsite("http://developer.android.com/tools/support-library/index.html")
.build()
)
.addAttributions(
new Attribution.Builder("HtmlTextView for Android")
.addCopyrightNotice("Copyright 2013 Dominik Schürmann")
.addLicense(License.APACHE)
.setWebsite("https://github.com/PrivacyApps/html-textview")
.build()
)
.addAttributions(
new Attribution.Builder("LicenseTextView")
.addCopyrightNotice("Copyright 2016 JGabrielFreitas")
.addLicense(License.APACHE)
.setWebsite("https://github.com/jgabrielfreitas/LicenseTextView")
.build()
)
.addAttributions(
new Attribution.Builder("EasyFeedback")
.addCopyrightNotice("Copyright 2017 Ramankit Singh")
.addLicense(License.APACHE)
.setWebsite("https://github.com/webianks/EasyFeedback")
.build()
)
.addAttributions(
new Attribution.Builder("Material Design Icons")
.addCopyrightNotice("Copyright 2014, Austin Andrews")
.addLicense("SIL Open Font", "https://github.com/Templarian/MaterialDesign/blob/master/LICENSE")
.setWebsite("https://materialdesignicons.com/")
.build()
)
.addAttributions(
new Attribution.Builder("ChangeLog Library")
.addCopyrightNotice("Copyright 2013-2015 Gabriele Mariotti")
.addLicense(License.APACHE)
.setWebsite("https://github.com/gabrielemariotti/changeloglib")
.build()
)
.addAttributions(
new Attribution.Builder("Cyanea")
.addCopyrightNotice("Copyright 2018 Jared Rummler")
.addLicense(License.APACHE)
.setWebsite("https://github.com/jaredrummler/Cyanea")
.build()
)
.build();
//show license dialogue
attributionPresenter.showDialog("Open Source Libraries");
}
public void emailDev(View v) {
startActivity(Utils.emailIntent("gokulswami@live.com", "Pdf Viewer Plus", APP_VERSION_RELEASE, "Send email..."));
}
public void navToGit(View v) {
startActivity(Utils.linkIntent("https://github.com/JavaCafe01"));
}
public void navToSourceCode(View v) {
startActivity(Utils.linkIntent("https://github.com/JavaCafe01/TorchLight"));
}
public void showNotice(View v) {
Utils.showNotice(this);
}
}