Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
6
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
DAVx⁵
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
2
Merge Requests
2
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
bitfire web engineering
DAVx⁵
Commits
64ad7083
Commit
64ad7083
authored
Apr 24, 2017
by
Ricki Hirner
🐑
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use untranslated User-Agent string
* refactoring: don't use global string variables
parent
d4e38644
Pipeline
#7838810
passed with stage
in 15 minutes and 35 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
32 deletions
+28
-32
app/src/main/java/at/bitfire/davdroid/App.java
app/src/main/java/at/bitfire/davdroid/App.java
+0
-6
app/src/main/java/at/bitfire/davdroid/HttpClient.java
app/src/main/java/at/bitfire/davdroid/HttpClient.java
+1
-1
app/src/main/java/at/bitfire/davdroid/ui/AboutActivity.java
app/src/main/java/at/bitfire/davdroid/ui/AboutActivity.java
+22
-22
app/src/main/java/at/bitfire/davdroid/ui/AccountsActivity.java
...rc/main/java/at/bitfire/davdroid/ui/AccountsActivity.java
+5
-3
No files found.
app/src/main/java/at/bitfire/davdroid/App.java
View file @
64ad7083
...
...
@@ -58,9 +58,6 @@ public class App extends Application {
public
static
final
String
OVERRIDE_PROXY_HOST_DEFAULT
=
"localhost"
;
public
static
final
int
OVERRIDE_PROXY_PORT_DEFAULT
=
8118
;
@Getter
private
static
String
appName
,
homepageUrl
;
@Getter
private
CustomCertManager
certManager
;
...
...
@@ -89,9 +86,6 @@ public class App extends Application {
public
void
onCreate
()
{
super
.
onCreate
();
appName
=
getString
(
R
.
string
.
app_name
);
homepageUrl
=
getString
(
R
.
string
.
homepage_url
);
reinitCertManager
();
reinitLogger
();
...
...
app/src/main/java/at/bitfire/davdroid/HttpClient.java
View file @
64ad7083
...
...
@@ -42,7 +42,7 @@ public class HttpClient {
private
static
final
String
userAgent
;
static
{
String
date
=
new
SimpleDateFormat
(
"yyyy/MM/dd"
,
Locale
.
US
).
format
(
new
Date
(
BuildConfig
.
buildTime
));
userAgent
=
App
.
getAppName
()
+
"
/"
+
BuildConfig
.
VERSION_NAME
+
" ("
+
date
+
"; dav4android; okhttp3) Android/"
+
Build
.
VERSION
.
RELEASE
;
userAgent
=
"DAVdroid
/"
+
BuildConfig
.
VERSION_NAME
+
" ("
+
date
+
"; dav4android; okhttp3) Android/"
+
Build
.
VERSION
.
RELEASE
;
}
private
HttpClient
()
{
...
...
app/src/main/java/at/bitfire/davdroid/ui/AboutActivity.java
View file @
64ad7083
...
...
@@ -31,7 +31,6 @@ import android.view.ViewGroup;
import
android.widget.TextView
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.lang3.time.DateFormatUtils
;
import
java.io.IOException
;
import
java.io.InputStream
;
...
...
@@ -46,33 +45,22 @@ import lombok.RequiredArgsConstructor;
public
class
AboutActivity
extends
AppCompatActivity
{
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_about
);
setSupportActionBar
((
Toolbar
)
findViewById
(
R
.
id
.
toolbar
));
getSupportActionBar
().
setDisplayHomeAsUpEnabled
(
true
);
ViewPager
viewPager
=
(
ViewPager
)
findViewById
(
R
.
id
.
viewpager
);
viewPager
.
setAdapter
(
new
TabsAdapter
(
getSupportFragmentManager
()));
TabLayout
tabLayout
=
(
TabLayout
)
findViewById
(
R
.
id
.
tabs
);
tabLayout
.
setupWithViewPager
(
viewPager
);
}
@RequiredArgsConstructor
private
static
class
ComponentInfo
{
final
String
title
,
version
,
website
,
copyright
;
final
int
licenseInfo
;
final
String
licenseTextFile
;
}
private
static
ComponentInfo
components
[];
private
final
static
ComponentInfo
components
[]
=
{
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
components
=
new
ComponentInfo
[]
{
new
ComponentInfo
(
App
.
getAppName
(),
BuildConfig
.
VERSION_NAME
,
App
.
getHomepageUrl
(
),
DateFormatUtils
.
format
(
BuildConfig
.
buildTime
,
"yyyy"
)
+
"
Ricki Hirner, Bernhard Stockmann (bitfire web engineering)"
,
getString
(
R
.
string
.
app_name
),
BuildConfig
.
VERSION_NAME
,
getString
(
R
.
string
.
homepage_url
),
"
Ricki Hirner, Bernhard Stockmann (bitfire web engineering)"
,
R
.
string
.
about_license_info_no_warranty
,
"gpl-3.0-standalone.html"
),
new
ComponentInfo
(
"AmbilWarna"
,
null
,
"https://github.com/yukuku/ambilwarna"
,
...
...
@@ -96,7 +84,19 @@ public class AboutActivity extends AppCompatActivity {
"Project Lombok"
,
null
,
"https://projectlombok.org/"
,
"The Project Lombok Authors"
,
R
.
string
.
about_license_info_no_warranty
,
"mit.html"
)
};
};
setContentView
(
R
.
layout
.
activity_about
);
setSupportActionBar
((
Toolbar
)
findViewById
(
R
.
id
.
toolbar
));
getSupportActionBar
().
setDisplayHomeAsUpEnabled
(
true
);
ViewPager
viewPager
=
(
ViewPager
)
findViewById
(
R
.
id
.
viewpager
);
viewPager
.
setAdapter
(
new
TabsAdapter
(
getSupportFragmentManager
()));
TabLayout
tabLayout
=
(
TabLayout
)
findViewById
(
R
.
id
.
tabs
);
tabLayout
.
setupWithViewPager
(
viewPager
);
}
private
static
class
TabsAdapter
extends
FragmentPagerAdapter
{
...
...
@@ -137,7 +137,7 @@ public class AboutActivity extends AppCompatActivity {
@Override
@SuppressLint
(
"SetTextI18n"
)
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
ComponentInfo
info
=
components
[
getArguments
().
getInt
(
KEY_POSITION
)];
ComponentInfo
info
=
((
AboutActivity
)
getActivity
()).
components
[
getArguments
().
getInt
(
KEY_POSITION
)];
View
v
=
inflater
.
inflate
(
R
.
layout
.
about_component
,
container
,
false
);
...
...
app/src/main/java/at/bitfire/davdroid/ui/AccountsActivity.java
View file @
64ad7083
...
...
@@ -130,16 +130,18 @@ public class AccountsActivity extends AppCompatActivity implements NavigationVie
startActivity
(
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
"https://twitter.com/davdroidapp"
)));
break
;
case
R
.
id
.
nav_website
:
startActivity
(
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
App
.
getHomepageUrl
(
))));
startActivity
(
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
getString
(
R
.
string
.
homepage_url
))));
break
;
case
R
.
id
.
nav_faq
:
startActivity
(
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
getString
(
R
.
string
.
navigation_drawer_faq_url
))));
break
;
case
R
.
id
.
nav_forums
:
startActivity
(
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
App
.
getHomepageUrl
()).
buildUpon
().
appendEncodedPath
(
"forums/"
).
build
()));
startActivity
(
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
getString
(
R
.
string
.
homepage_url
))
.
buildUpon
().
appendEncodedPath
(
"forums/"
).
build
()));
break
;
case
R
.
id
.
nav_donate
:
startActivity
(
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
App
.
getHomepageUrl
()).
buildUpon
().
appendEncodedPath
(
"donate/"
).
build
()));
startActivity
(
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
getString
(
R
.
string
.
homepage_url
))
.
buildUpon
().
appendEncodedPath
(
"donate/"
).
build
()));
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment