summaryrefslogtreecommitdiff
path: root/app/src/main/java/foundation/e
diff options
context:
space:
mode:
authorAmit Kumar <amitkma@e.email>2021-04-29 14:49:04 +0530
committerAmit Kumar <amitkma@e.email>2021-04-29 14:49:04 +0530
commit75843f012b09f0f11da4aec10be2f378465a94c2 (patch)
treef4899137359bc36802bffc6a6274741c37201660 /app/src/main/java/foundation/e
parent1f74d52c1a9ba81ad3a268a08cabb1b62911e2cf (diff)
Add dashboard feature UI
Diffstat (limited to 'app/src/main/java/foundation/e')
-rw-r--r--app/src/main/java/foundation/e/privacycentralapp/features/dashboard/DashboardActivity.kt (renamed from app/src/main/java/foundation/e/privacycentralapp/features/MainActivity.kt)24
-rw-r--r--app/src/main/java/foundation/e/privacycentralapp/features/dashboard/DashboardFeature.kt (renamed from app/src/main/java/foundation/e/privacycentralapp/features/HomeFeature.kt)2
-rw-r--r--app/src/main/java/foundation/e/privacycentralapp/features/dashboard/DashboardViewModel.kt (renamed from app/src/main/java/foundation/e/privacycentralapp/features/HomeViewModel.kt)4
3 files changed, 25 insertions, 5 deletions
diff --git a/app/src/main/java/foundation/e/privacycentralapp/features/MainActivity.kt b/app/src/main/java/foundation/e/privacycentralapp/features/dashboard/DashboardActivity.kt
index eefb5e1..ef296ce 100644
--- a/app/src/main/java/foundation/e/privacycentralapp/features/MainActivity.kt
+++ b/app/src/main/java/foundation/e/privacycentralapp/features/dashboard/DashboardActivity.kt
@@ -15,15 +15,35 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-package foundation.e.privacycentralapp.features
+package foundation.e.privacycentralapp.features.dashboard
+import android.graphics.Color
import android.os.Bundle
+import android.text.Spannable
+import android.text.SpannableString
+import android.text.style.ForegroundColorSpan
+import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import foundation.e.privacycentralapp.R
-class MainActivity : AppCompatActivity() {
+class DashboardActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
+ title = "My Privacy Dashboard"
+ setSupportActionBar(findViewById(R.id.toolbar))
+
+ addClickToMore(findViewById<TextView>(R.id.personal_leakag_info))
+ }
+
+ private fun addClickToMore(textView: TextView) {
+ val clickToMore = SpannableString("Click to learn more")
+ clickToMore.setSpan(
+ ForegroundColorSpan(Color.parseColor("#007fff")),
+ 0,
+ clickToMore.length,
+ Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
+ )
+ textView.append(clickToMore)
}
}
diff --git a/app/src/main/java/foundation/e/privacycentralapp/features/HomeFeature.kt b/app/src/main/java/foundation/e/privacycentralapp/features/dashboard/DashboardFeature.kt
index 766d1fa..9b8e28f 100644
--- a/app/src/main/java/foundation/e/privacycentralapp/features/HomeFeature.kt
+++ b/app/src/main/java/foundation/e/privacycentralapp/features/dashboard/DashboardFeature.kt
@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-package foundation.e.privacycentralapp.features
+package foundation.e.privacycentralapp.features.dashboard
import foundation.e.flowmvi.Actor
import foundation.e.flowmvi.Reducer
diff --git a/app/src/main/java/foundation/e/privacycentralapp/features/HomeViewModel.kt b/app/src/main/java/foundation/e/privacycentralapp/features/dashboard/DashboardViewModel.kt
index 1a338f9..82c6c11 100644
--- a/app/src/main/java/foundation/e/privacycentralapp/features/HomeViewModel.kt
+++ b/app/src/main/java/foundation/e/privacycentralapp/features/dashboard/DashboardViewModel.kt
@@ -15,13 +15,13 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-package foundation.e.privacycentralapp.features
+package foundation.e.privacycentralapp.features.dashboard
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import foundation.e.flowmvi.feature.BaseFeature
-class HomeViewModel : ViewModel() {
+class DashboardViewModel : ViewModel() {
val homeFeature: BaseFeature<HomeFeature.State, HomeFeature.Action,
HomeFeature.Effect, HomeFeature.SingleEvent> by lazy {