Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
App Lounge
Commits
aebc1cc8
Commit
aebc1cc8
authored
Jan 20, 2019
by
Nihar Thakkar
Browse files
Handle unavailable exodus permissions/trackers separately from no permissions/trackers
parent
1a2af130
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/io/eelo/appinstaller/application/ApplicationActivity.kt
View file @
aebc1cc8
...
...
@@ -330,13 +330,14 @@ class ApplicationActivity : AppCompatActivity(), ApplicationStateListener,
app_permissions_container
.
setOnClickListener
{
val
alertDialog
=
AlertDialog
.
Builder
(
this
).
create
()
alertDialog
.
setTitle
(
R
.
string
.
app_permissions_title
)
if
(
fullData
.
getLastVersion
()
!=
null
)
{
if
(
fullData
.
getLastVersion
()
!!
.
exodusPermissions
.
isNotEmpty
())
{
if
(
fullData
.
getLastVersion
()
!=
null
&&
fullData
.
getLastVersion
()
!!
.
exodusPermissions
!=
null
)
{
if
(
fullData
.
getLastVersion
()
!!
.
exodusPermissions
!!
.
isNotEmpty
())
{
var
message
=
""
var
index
=
0
fullData
.
getLastVersion
()
!!
.
exodusPermissions
.
forEach
{
permission
->
fullData
.
getLastVersion
()
!!
.
exodusPermissions
!!
.
forEach
{
permission
->
message
+=
permission
if
(
index
!=
fullData
.
getLastVersion
()
!!
.
exodusPermissions
.
size
-
1
)
{
if
(
index
!=
fullData
.
getLastVersion
()
!!
.
exodusPermissions
!!
.
size
-
1
)
{
message
+=
"\n"
}
index
++
...
...
@@ -359,13 +360,14 @@ class ApplicationActivity : AppCompatActivity(), ApplicationStateListener,
app_trackers_container
.
setOnClickListener
{
val
alertDialog
=
AlertDialog
.
Builder
(
this
).
create
()
alertDialog
.
setTitle
(
R
.
string
.
app_trackers_title
)
if
(
fullData
.
getLastVersion
()
!=
null
)
{
if
(
fullData
.
getLastVersion
()
!!
.
exodusTrackers
.
isNotEmpty
())
{
if
(
fullData
.
getLastVersion
()
!=
null
&&
fullData
.
getLastVersion
()
!!
.
exodusTrackers
!=
null
)
{
if
(
fullData
.
getLastVersion
()
!!
.
exodusTrackers
!!
.
isNotEmpty
())
{
var
message
=
""
var
index
=
0
fullData
.
getLastVersion
()
!!
.
exodusTrackers
.
forEach
{
tracker
->
fullData
.
getLastVersion
()
!!
.
exodusTrackers
!!
.
forEach
{
tracker
->
message
+=
tracker
if
(
index
!=
fullData
.
getLastVersion
()
!!
.
exodusTrackers
.
size
-
1
)
{
if
(
index
!=
fullData
.
getLastVersion
()
!!
.
exodusTrackers
!!
.
size
-
1
)
{
message
+=
"\n"
}
index
++
...
...
app/src/main/java/io/eelo/appinstaller/application/model/Version.kt
View file @
aebc1cc8
...
...
@@ -13,5 +13,5 @@ class Version(val downloadFlag: String?,
val
whatsNew
:
String
?,
val
updateName
:
String
,
val
privacyRating
:
Int
?,
val
exodusPermissions
:
ArrayList
<
String
>,
val
exodusTrackers
:
ArrayList
<
String
>)
\ No newline at end of file
val
exodusPermissions
:
ArrayList
<
String
>?,
val
exodusTrackers
:
ArrayList
<
String
>?)
\ No newline at end of file
app/src/main/java/io/eelo/appinstaller/application/model/data/FullData.kt
View file @
aebc1cc8
...
...
@@ -77,19 +77,27 @@ constructor(
}
}
private
fun
getPermissions
(
rawPermissions
:
ArrayList
<
String
>?):
ArrayList
<
String
>
{
val
permissions
=
ArrayList
<
String
>()
rawPermissions
?.
forEach
{
permissions
.
add
(
it
.
substring
(
it
.
lastIndexOf
(
"."
)
+
1
))
private
fun
getPermissions
(
rawPermissions
:
ArrayList
<
String
>?):
ArrayList
<
String
>?
{
return
if
(
rawPermissions
!=
null
)
{
val
permissions
=
ArrayList
<
String
>()
rawPermissions
.
forEach
{
permissions
.
add
(
it
.
substring
(
it
.
lastIndexOf
(
"."
)
+
1
))
}
permissions
}
else
{
null
}
return
permissions
}
private
fun
getTrackers
(
rawTrackers
:
ArrayList
<
LinkedHashMap
<
String
,
String
>>?):
ArrayList
<
String
>
{
val
trackers
=
ArrayList
<
String
>()
rawTrackers
?.
forEach
{
trackers
.
add
(
it
[
"name"
]
!!
)
private
fun
getTrackers
(
rawTrackers
:
ArrayList
<
LinkedHashMap
<
String
,
String
>>?):
ArrayList
<
String
>?
{
return
if
(
rawTrackers
!=
null
)
{
val
trackers
=
ArrayList
<
String
>()
rawTrackers
.
forEach
{
trackers
.
add
(
it
[
"name"
]
!!
)
}
trackers
}
else
{
null
}
return
trackers
}
}
\ No newline at end of file
}
Write
Preview
Supports
Markdown
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