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
4c80ca54
Commit
4c80ca54
authored
Dec 04, 2020
by
Mohit Mali
Committed by
Romain Hunault
Dec 04, 2020
Browse files
Download microG Notification Exposure version from Apps
Also revert UI revamping temporary
parent
cbe79c71
Changes
48
Hide whitespace changes
Inline
Side-by-side
app/build.gradle
View file @
4c80ca54
...
...
@@ -21,6 +21,7 @@ android {
minifyEnabled
false
proguardFiles
getDefaultProguardFile
(
'proguard-android.txt'
),
'proguard-rules.pro'
}
}
dataBinding
{
enabled
=
true
...
...
@@ -36,10 +37,6 @@ android {
androidExtensions
{
experimental
=
true
}
aaptOptions
{
additionalParameters
'-I'
,
'app/e-ui-sdk.jar'
}
}
dependencies
{
...
...
@@ -87,7 +84,7 @@ dependencies {
implementation
"com.fasterxml.jackson.core:jackson-databind:2.11.1"
implementation
"com.fasterxml.jackson.module:jackson-module-kotlin:2.11.1"
implementation
'com.
github.chrisbanes:PhotoView:2.3.0
'
implementation
'com.
android.volley:volley:1.1.1
'
co
mp
i
le
Only
files
(
"e-ui-sdk.jar"
)
i
mple
mentation
'com.github.chrisbanes:PhotoView:2.3.0'
}
app/e-ui-sdk.jar
deleted
100644 → 0
View file @
cbe79c71
File deleted
app/src/main/AndroidManifest.xml
View file @
4c80ca54
...
...
@@ -16,19 +16,19 @@
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"foundation.e.pwaplayer.provider.READ_WRITE"
/>
<uses-permission
android:name=
"foundation.e.pwaplayer.provider.READ_WRITE"
/>
<application
android:allowBackup=
"true"
android:alwaysRetainTaskState=
"true"
android:icon=
"@mipmap/ic_launcher"
android:label=
"@string/app_name"
android:roundIcon=
"@mipmap/ic_launcher"
android:supportsRtl=
"true"
android:largeHeap=
"true"
android:launchMode=
"singleInstance"
android:alwaysRetainTaskState=
"true"
android:roundIcon=
"@mipmap/ic_launcher"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
>
<!-- <activity android:name=".application.PwaInstaller"/>-->
<!-- <activity android:name=".application.PwaInstaller"/>-->
<activity
android:name=
".settings.AppRequestActivity"
/>
<activity
android:name=
".MainActivity"
>
<intent-filter>
...
...
@@ -40,7 +40,6 @@
<activity
android:name=
".application.ApplicationActivity"
/>
<activity
android:name=
".categories.category.CategoryActivity"
/>
<service
android:name=
".applicationmanager.ApplicationManagerService"
android:description=
"@string/service_description"
...
...
@@ -48,7 +47,7 @@
<provider
android:name=
"androidx.core.content.FileProvider"
android:authorities=
"
foundation.e.apps
.provider"
android:authorities=
"
${applicationId}
.provider"
android:exported=
"false"
android:grantUriPermissions=
"true"
>
<meta-data
...
...
@@ -67,8 +66,8 @@
android:name=
".XAPK.InstallSplitApksActivity"
android:configChanges=
"screenSize|orientation|keyboardHidden"
android:launchMode=
"singleInstance"
android:
windowSoftInputMode=
"adjustResize
"
android:
theme=
"@style/AppTheme1"
/>
android:
theme=
"@style/AppTheme1
"
android:
windowSoftInputMode=
"adjustResize"
/>
</application>
</manifest>
\ No newline at end of file
app/src/main/java/foundation/e/apps/MainActivity.kt
View file @
4c80ca54
...
...
@@ -19,24 +19,15 @@ package foundation.e.apps
//import androidx.fragment.app.ListFragment
import
android.annotation.SuppressLint
import
android.content.*
import
android.content.pm.PackageManager
import
android.content.res.ColorStateList
import
android.graphics.Color
import
android.os.Bundle
import
android.os.Handler
import
android.preference.PreferenceManager
import
android.util.TypedValue
import
android.view.MenuItem
import
android.widget.Toast
import
androidx.annotation.ColorInt
import
androidx.annotation.ColorRes
import
androidx.appcompat.app.AppCompatActivity
import
androidx.appcompat.view.ContextThemeWrapper
import
androidx.core.content.ContextCompat
import
androidx.core.graphics.drawable.DrawableCompat
import
androidx.fragment.app.Fragment
import
com.google.android.material.bottomnavigation.BottomNavigationItemView
import
com.google.android.material.bottomnavigation.BottomNavigationMenuView
...
...
@@ -69,26 +60,22 @@ class MainActivity : AppCompatActivity(), BottomNavigationView.OnNavigationItemS
private
val
codeRequestPermissions
=
9527
var
doubleBackToExitPressedOnce
=
false
;
private
var
isReceiverRegistered
=
false
var
accentColorOS
=
0
companion
object
{
lateinit
var
mActivity
:
MainActivity
var
sharedPreferences
:
SharedPreferences
?=
null
val
sharedPrefFile
=
"kotlinsharedpreference"
}
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
//ThemeColors(this);
setContentView
(
R
.
layout
.
activity_main
)
mActivity
=
this
disableCategoryIfOpenSource
()
bottom_navigation_view
.
setOnNavigationItemSelectedListener
{
if
(
selectFragment
(
it
.
itemId
,
it
))
{
disableCategoryIfOpenSource
()
...
...
@@ -115,28 +102,6 @@ class MainActivity : AppCompatActivity(), BottomNavigationView.OnNavigationItemS
}
setupLangReceiver
()
applicationManagerServiceConnection
.
bindService
(
this
)
getAccentColor
();
bottom_navigation_view_color
()
}
private
fun
bottom_navigation_view_color
()
{
val
iconsColorStates
=
ColorStateList
(
arrayOf
(
intArrayOf
(-
android
.
R
.
attr
.
state_checked
),
intArrayOf
(
android
.
R
.
attr
.
state_checked
)),
intArrayOf
(
Color
.
parseColor
(
"#C4CFD9"
),
accentColorOS
))
val
textColorStates
=
ColorStateList
(
arrayOf
(
intArrayOf
(-
android
.
R
.
attr
.
state_checked
),
intArrayOf
(
android
.
R
.
attr
.
state_checked
)),
intArrayOf
(
Color
.
parseColor
(
"#C4CFD9"
),
accentColorOS
))
bottom_navigation_view
.
setItemIconTintList
(
iconsColorStates
)
bottom_navigation_view
.
setItemTextColor
(
textColorStates
)
}
private
fun
initialiseUpdatesWorker
()
{
...
...
@@ -151,9 +116,9 @@ class MainActivity : AppCompatActivity(), BottomNavigationView.OnNavigationItemS
}
private
fun
initialiseFragments
(
applicationManager
:
ApplicationManager
)
{
homeFragment
.
initialise
(
applicationManager
,
accentColorOS
)
searchFragment
.
initialise
(
applicationManager
,
accentColorOS
)
updatesFragment
.
initialise
(
applicationManager
,
accentColorOS
)
homeFragment
.
initialise
(
applicationManager
)
searchFragment
.
initialise
(
applicationManager
)
updatesFragment
.
initialise
(
applicationManager
)
}
override
fun
onNavigationItemSelected
(
item
:
MenuItem
):
Boolean
{
...
...
@@ -179,28 +144,17 @@ class MainActivity : AppCompatActivity(), BottomNavigationView.OnNavigationItemS
return
"any"
}
fun
tintMenuIcon
(
context
:
Context
,
item
:
MenuItem
,
@ColorRes
color
:
Int
)
{
val
normalDrawable
=
item
.
icon
val
wrapDrawable
=
DrawableCompat
.
wrap
(
normalDrawable
)
DrawableCompat
.
setTint
(
wrapDrawable
,
ContextCompat
.
getColor
(
context
,
color
))
//context.resources.getColor(color))
item
.
icon
=
wrapDrawable
}
private
fun
selectFragment
(
fragmentId
:
Int
,
item
:
MenuItem
?):
Boolean
{
when
(
fragmentId
)
{
R
.
id
.
menu_home
->
{
item
?.
setIcon
(
R
.
drawable
.
ic_menu_home
)
showFragment
(
homeFragment
)
return
true
}
R
.
id
.
menu_categories
->
{
item
?.
setIcon
(
R
.
drawable
.
ic_menu_categories
)
showFragment
(
CategoriesFragment
())
return
true
}
R
.
id
.
menu_search
->
{
...
...
@@ -311,17 +265,4 @@ class MainActivity : AppCompatActivity(), BottomNavigationView.OnNavigationItemS
}
},
2000
)
}
/*
* get Accent color from OS
*
* */
private
fun
getAccentColor
()
{
accentColorOS
=
this
.
resources
.
getColor
(
R
.
color
.
colorAccent
);
}
}
\ No newline at end of file
}
app/src/main/java/foundation/e/apps/api/GitlabDataRequest.kt
0 → 100644
View file @
4c80ca54
/*
Copyright (C) 2019 e Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package
foundation.e.apps.api
import
android.content.Context
import
android.os.Build
import
com.google.gson.Gson
import
com.google.gson.JsonParser
import
foundation.e.apps.application.model.Application
import
foundation.e.apps.application.model.data.BasicData
import
foundation.e.apps.application.model.release.ReleaseData
import
foundation.e.apps.applicationmanager.ApplicationManager
import
foundation.e.apps.utils.*
import
java.io.InputStreamReader
class
GitlabDataRequest
{
fun
requestGmsCoreRelease
(
callback
:
(
Error
?,
GitlabDataResult
?)
->
Unit
)
=
try
{
val
url
=
Constants
.
RELEASE_API
+
Constants
.
MICROG_ID
+
Constants
.
RELEASE_ENDPOINT
val
urlConnection
=
Common
.
createConnection
(
url
,
Constants
.
REQUEST_METHOD_GET
)
val
isr
=
InputStreamReader
(
urlConnection
.
inputStream
)
val
element
=
JsonParser
().
parse
(
isr
)
val
releaseList
:
List
<
ReleaseData
>
=
Gson
().
fromJson
(
element
.
toString
(),
Array
<
ReleaseData
>
::
class
.
java
).
toList
()
urlConnection
.
disconnect
()
var
buildTag
=
Build
.
TAGS
.
split
(
"-"
).
toTypedArray
();
val
osReleaseType
=
buildTag
[
0
];
var
releaseUrl
=
""
releaseList
[
0
].
assets
.
links
.
forEach
{
if
(
it
.
name
.
contains
(
osReleaseType
))
{
releaseUrl
=
it
.
url
}
}
callback
.
invoke
(
null
,
GitlabDataResult
(
SystemAppDataSource
.
createDataSource
(
Constants
.
MICROG_ID
.
toString
(),
releaseList
[
0
].
tag_name
,
Constants
.
MICROG_ICON_URI
,
releaseUrl
)))
}
catch
(
e
:
Exception
)
{
callback
.
invoke
(
Error
.
findError
(
e
),
null
)
}
class
GitlabDataResult
(
private
val
data
:
BasicData
)
{
fun
getApplications
(
applicationManager
:
ApplicationManager
,
context
:
Context
):
ArrayList
<
Application
>
{
return
ApplicationParser
.
parseSystemAppData
(
applicationManager
,
context
,
data
)
}
}
}
app/src/main/java/foundation/e/apps/api/ListApplicationsRequest.kt
View file @
4c80ca54
...
...
@@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty
import
foundation.e.apps.MainActivity.Companion.mActivity
import
foundation.e.apps.application.model.Application
import
foundation.e.apps.application.model.data.BasicData
import
foundation.e.apps.application.model.release.ReleaseData
import
foundation.e.apps.applicationmanager.ApplicationManager
import
foundation.e.apps.utils.ApplicationParser
import
foundation.e.apps.utils.Common
...
...
@@ -59,6 +60,4 @@ class ListApplicationsRequest(private val category: String, private val page: In
}
}
}
app/src/main/java/foundation/e/apps/api/ListPwasRequest.kt
View file @
4c80ca54
...
...
@@ -26,7 +26,6 @@ class ListPwasRequest(private val category: String, private val page: Int, priva
urlConnection
.
disconnect
()
callback
.
invoke
(
null
,
result
)
}
catch
(
e
:
Exception
)
{
callback
.
invoke
(
Error
.
findError
(
e
),
null
)
}
...
...
app/src/main/java/foundation/e/apps/application/ApplicationActivity.kt
View file @
4c80ca54
...
...
@@ -32,7 +32,6 @@ import android.text.SpannableStringBuilder
import
android.text.method.LinkMovementMethod
import
android.text.style.ForegroundColorSpan
import
android.util.DisplayMetrics
import
android.util.Log
import
android.util.TypedValue
import
android.view.Menu
import
android.view.MenuItem
...
...
@@ -40,10 +39,8 @@ import android.view.View
import
android.widget.ImageView
import
android.widget.LinearLayout
import
android.widget.TextView
import
androidx.annotation.ColorInt
import
androidx.appcompat.app.AlertDialog
import
androidx.appcompat.app.AppCompatActivity
import
androidx.appcompat.view.ContextThemeWrapper
import
androidx.appcompat.widget.Toolbar
import
com.google.android.material.snackbar.Snackbar
import
foundation.e.apps.MainActivity.Companion.sharedPreferences
...
...
@@ -93,7 +90,7 @@ class ApplicationActivity :
private
var
imageMargin
=
0
private
var
defaultElevation
=
0f
private
val
sharedPrefFile
=
"kotlinsharedpreference"
var
accentColorOS
=
0
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
...
...
@@ -116,14 +113,6 @@ class ApplicationActivity :
this
.
applicationPackageName
=
applicationPackageName
!!
applicationManagerServiceConnection
.
bindService
(
this
)
}
getAccentColor
()
app_install
.
setTextColor
(
Color
.
parseColor
(
"#ffffff"
))
app_install
.
setBackgroundColor
(
accentColorOS
)
app_category
.
setTextColor
(
accentColorOS
)
app_expand_description
.
setTextColor
(
accentColorOS
)
}
...
...
@@ -760,8 +749,4 @@ class ApplicationActivity :
applicationManagerServiceConnection
.
unbindService
(
this
)
}
}
private
fun
getAccentColor
()
{
accentColorOS
=
this
.
resources
.
getColor
(
R
.
color
.
colorAccent
);
}
}
app/src/main/java/foundation/e/apps/application/ApplicationViewHolder.kt
View file @
4c80ca54
...
...
@@ -19,6 +19,7 @@ package foundation.e.apps.application
import
android.annotation.SuppressLint
import
android.app.Activity
import
android.content.Context
import
android.graphics.Bitmap
import
android.graphics.Color
import
android.view.Gravity
...
...
@@ -39,23 +40,25 @@ import foundation.e.apps.application.model.data.PwasBasicData
import
foundation.e.apps.application.viewmodel.ApplicationViewModel
import
foundation.e.apps.utils.Common
import
foundation.e.apps.utils.Common.toMiB
import
foundation.e.apps.utils.Constants
import
foundation.e.apps.utils.Error
import
foundation.e.apps.utils.Execute
import
kotlinx.android.synthetic.main.application_list_item.view.*
import
kotlinx.android.synthetic.main.install_button_layout.view.*
import
java.lang.Exception
class
ApplicationViewHolder
(
private
val
activity
:
Activity
,
private
val
view
:
View
,
accentColorOS
:
Int
)
:
class
ApplicationViewHolder
(
private
val
activity
:
Activity
,
private
val
view
:
View
)
:
RecyclerView
.
ViewHolder
(
view
),
ApplicationStateListener
,
Downloader
.
DownloadProgressCallback
,
BasicData
.
IconLoaderCallback
,
PwasBasicData
.
IconLoaderCallback
{
PwasBasicData
.
IconLoaderCallback
{
private
val
icon
:
ImageView
=
view
.
app_icon
private
val
title
:
TextView
=
view
.
app_title
private
val
pwa_icon
:
TextView
=
view
.
pwa_sympol
private
val
pwa_icon
:
TextView
=
view
.
pwa_sympol
private
val
author
:
TextView
=
view
.
app_author
private
val
ratingBar
:
RatingBar
=
view
.
app_rating_bar
private
val
rating
:
TextView
=
view
.
app_rating
...
...
@@ -64,32 +67,28 @@ class ApplicationViewHolder(private val activity: Activity, private val view: Vi
private
var
application
:
Application
?
=
null
private
val
applicationViewModel
=
ApplicationViewModel
()
private
var
downloader
:
Downloader
?
=
null
var
accentColorOS
=
accentColorOS
;
init
{
pwa_icon
.
visibility
=
View
.
GONE
pwa_icon
.
visibility
=
View
.
GONE
view
.
setOnClickListener
{
if
(
application
!=
null
)
{
applicationViewModel
.
onApplicationClick
(
view
.
context
,
application
!!
)
if
(
application
!!
.
packageName
!=
Constants
.
MICROG_PACKAGE
)
applicationViewModel
.
onApplicationClick
(
view
.
context
,
application
!!
)
}
}
installButton
.
setTextColor
(
Color
.
parseColor
(
"#ffffff"
))
if
(
0
!=
this
.
accentColorOS
){
installButton
.
setBackgroundColor
(
this
.
accentColorOS
)
}
installButton
?.
setOnClickListener
{
if
(
application
?.
fullData
!=
null
&&
application
!!
.
fullData
!!
.
getLastVersion
()
==
null
)
{
Snackbar
.
make
(
view
,
activity
.
getString
(
Error
.
APK_UNAVAILABLE
.
description
),
Snackbar
.
LENGTH_LONG
).
show
()
}
else
if
(
application
?.
pwabasicdata
!=
null
)
{
}
else
if
(
application
?.
pwabasicdata
!=
null
){
application
?.
pwaInstall
(
activity
)
}
else
if
(
application
?.
searchAppsBasicData
!=
null
&&
application
?.
searchAppsBasicData
!!
.
is_pwa
)
{
}
else
if
(
application
?.
searchAppsBasicData
!=
null
&&
application
?.
searchAppsBasicData
!!
.
is_pwa
){
application
?.
pwaInstall
(
activity
)
}
else
{
}
else
{
application
?.
buttonClicked
(
activity
,
activity
)
}
}
...
...
@@ -97,46 +96,46 @@ var accentColorOS=accentColorOS;
fun
createApplicationView
(
app
:
Application
)
{
pwa_icon
.
visibility
=
View
.
GONE
this
.
application
=
app
if
(
app
.
basicData
!=
null
)
{
this
.
application
?.
removeListener
(
this
)
this
.
application
=
app
icon
.
setImageDrawable
(
view
.
context
.
resources
.
getDrawable
(
R
.
drawable
.
ic_app_default
))
application
!!
.
loadIcon
(
this
)
application
!!
.
addListener
(
this
)
title
.
text
=
application
!!
.
basicData
!!
.
name
author
.
text
=
application
!!
.
basicData
!!
.
author
ratingBar
.
rating
=
application
!!
.
basicData
!!
.
ratings
!!
.
rating
!!
if
(
application
!!
.
basicData
!!
.
ratings
!!
.
rating
!=
-
1f
)
{
rating
.
text
=
application
!!
.
basicData
!!
.
ratings
!!
.
rating
.
toString
()
}
else
{
rating
.
text
=
activity
.
getString
(
R
.
string
.
not_available
)
}
if
(
application
!!
.
basicData
!!
.
privacyRating
!=
null
&&
application
!!
.
basicData
!!
.
privacyRating
!=
-
1f
)
{
privacyScore
.
text
=
application
!!
.
basicData
!!
.
privacyRating
.
toString
()
}
else
{
privacyScore
.
text
=
activity
.
getString
(
R
.
string
.
not_available
)
}
}
else
{
this
.
application
?.
removeListener
(
this
)
pwa_icon
.
visibility
=
View
.
GONE
this
.
application
=
app
icon
.
setImageDrawable
(
view
.
context
.
resources
.
getDrawable
(
R
.
drawable
.
ic_app_default
))
application
!!
.
addListener
(
this
)
if
(
application
!!
.
searchAppsBasicData
!=
null
)
{
if
(
application
!!
.
searchAppsBasicData
!!
.
is_pwa
)
{
pwa_icon
.
visibility
=
View
.
VISIBLE
if
(
app
.
basicData
!=
null
)
{
this
.
application
?.
removeListener
(
this
)
this
.
application
=
app
icon
.
setImageDrawable
(
view
.
context
.
resources
.
getDrawable
(
R
.
drawable
.
ic_app_default
))
application
!!
.
loadIcon
(
this
)
application
!!
.
addListener
(
this
)
title
.
text
=
application
!!
.
basicData
!!
.
name
author
.
text
=
application
!!
.
basicData
!!
.
author
ratingBar
.
rating
=
application
!!
.
basicData
!!
.
ratings
!!
.
rating
!!
if
(
application
!!
.
basicData
!!
.
ratings
!!
.
rating
!=
-
1f
)
{
rating
.
text
=
application
!!
.
basicData
!!
.
ratings
!!
.
rating
.
toString
()
}
else
{
rating
.
text
=
activity
.
getString
(
R
.
string
.
not_available
)
}
if
(
application
!!
.
basicData
!!
.
privacyRating
!=
null
&&
application
!!
.
basicData
!!
.
privacyRating
!=
-
1f
)
{
privacyScore
.
text
=
application
!!
.
basicData
!!
.
privacyRating
.
toString
()
}
else
{
privacyScore
.
text
=
activity
.
getString
(
R
.
string
.
not_available
)
}
application
!!
.
SearchAppsloadIcon
(
this
)
title
.
text
=
application
!!
.
searchAppsBasicData
!!
.
name
author
.
text
=
application
!!
.
searchAppsBasicData
!!
.
author
}
else
{
application
!!
.
PwaloadIcon
(
this
)
title
.
text
=
application
!!
.
pwabasicdata
!!
.
name
}
else
{
this
.
application
?.
removeListener
(
this
)
this
.
application
=
app
icon
.
setImageDrawable
(
view
.
context
.
resources
.
getDrawable
(
R
.
drawable
.
ic_app_default
))
application
!!
.
addListener
(
this
)
if
(
application
!!
.
searchAppsBasicData
!=
null
)
{
if
(
application
!!
.
searchAppsBasicData
!!
.
is_pwa
)
{
pwa_icon
.
visibility
=
View
.
VISIBLE
}
application
!!
.
SearchAppsloadIcon
(
this
)
title
.
text
=
application
!!
.
searchAppsBasicData
!!
.
name
author
.
text
=
application
!!
.
searchAppsBasicData
!!
.
author
}
else
{
application
!!
.
PwaloadIcon
(
this
)
title
.
text
=
application
!!
.
pwabasicdata
!!
.
name
}
}
}
stateChanged
(
application
!!
.
state
)
}
...
...
@@ -148,47 +147,30 @@ var accentColorOS=accentColorOS;
override
fun
stateChanged
(
state
:
State
)
{
Execute
({},
{
// installButton.setBackgroundResource(R.drawable.app_install_border_simple)
installButton
.
setBackgroundResource
(
R
.
drawable
.
app_install_border_simple
)
installButton
?.
text
=
activity
.
getString
(
state
.
installButtonTextId
)
when
(
state
)
{
State
.
NOT_DOWNLOADED
->
{
if
(
0
!=
this
.
accentColorOS
){
installButton
.
setTextColor
(
this
.
accentColorOS
)
}
else
{
when
(
state
)
{
installButton
.
setTextColor
(
Color
.
parseColor
(
"#0088ED"
))
}
State
.
NOT_DOWNLOADED
->{
installButton
.
setTextColor
(
Color
.
parseColor
(
"#0088ED"
))
installButton
.
setBackgroundResource
(
R
.
drawable
.
app_install_border_simple
)
installButton
.
isEnabled
=
true
}
State
.
INSTALLED
->
{
installButton
?.
isEnabled
=
Common
.
appHasLaunchActivity
(
activity
,
application
!!
.
packageName
)
if
(
0
!=
this
.
accentColorOS
){
installButton
!!
.
setBackgroundColor
(
this
.
accentColorOS
)
}
else
{
installButton
!!
.
setBackgroundResource
(
R
.
drawable
.
app_install_border
)
}
installButton
.
setTextColor
(
Color
.
parseColor
(
"#FAFAFA"
))
installButton
!!
.
setBackgroundResource
(
R
.
drawable
.
app_install_border
)
}
State
.
INSTALLING
->
{
installButton
?.
isEnabled
=
false
}
State
.
NOT_UPDATED
->
{
installButton
.
setTextColor
(
Color
.
parseColor
(
"#FAFAFA"
))
//installButton!!.setBackgroundResource(R.drawable.app_install_border)
if
(
0
!=
this
.
accentColorOS
){
installButton
!!
.
setBackgroundColor
(
this
.
accentColorOS
)
}
else
{
installButton
!!
.
setBackgroundResource
(
R
.
drawable
.
app_install_border
)
}
installButton
!!
.
setBackgroundResource
(
R
.
drawable
.
app_install_border
)
installButton
?.
isEnabled
=
true
}
else
->
{
...
...
@@ -196,7 +178,6 @@ var accentColorOS=accentColorOS;
installButton
?.
isEnabled
=
true
}
}
})
}
...
...
@@ -223,5 +204,4 @@ var accentColorOS=accentColorOS;