From 5640b7e56c1b872efbe2bcef95d4de7ca528d7d0 Mon Sep 17 00:00:00 2001 From: davidoskky Date: Fri, 15 Oct 2021 20:14:21 +0200 Subject: [PATCH] Upgrade MaterialDrawer (#359) * Upgrade material drawer library * Add footer options to drawer * Apply styles to drawer * Added sources and tags to side drawer * Hide bottom bar when the side drawer is opened * Display hamburger icon to open the side drawer * Add information about libraries to the side drawer * Cleanup * Implement reloading badges --- app/build.gradle | 3 +- .../bou/readerforselfoss/HomeActivity.kt | 378 +++++++++--------- .../apps/amine/bou/readerforselfoss/MyApp.kt | 11 +- .../api/selfoss/SelfossModels.kt | 6 +- .../bou/readerforselfoss/themes/AppColors.kt | 4 +- app/src/main/res/layout/activity_home.xml | 76 ++-- app/src/main/res/values/styles.xml | 27 +- 7 files changed, 265 insertions(+), 240 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 8cd83c9..5a5e612 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -108,6 +108,7 @@ dependencies { implementation 'androidx.vectordrawable:vectordrawable:1.2.0-alpha02' implementation "androidx.browser:browser:1.3.0" implementation "androidx.cardview:cardview:$android_version" + implementation "androidx.annotation:annotation:1.2.0" implementation 'androidx.constraintlayout:constraintlayout:2.1.1' implementation 'org.jsoup:jsoup:1.13.1' @@ -138,7 +139,7 @@ dependencies { implementation 'com.github.bumptech.glide:okhttp3-integration:4.1.1' // Drawer - implementation 'co.zsmb:materialdrawer-kt:2.0.2' + implementation 'com.mikepenz:materialdrawer:8.4.4' // Themes implementation 'com.52inc:scoops:1.0.0' diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/HomeActivity.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/HomeActivity.kt index beb9f50..77f1632 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/HomeActivity.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/HomeActivity.kt @@ -14,11 +14,13 @@ import android.view.Menu import android.view.MenuItem import android.view.View import android.widget.Toast +import androidx.appcompat.app.ActionBarDrawerToggle import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.widget.SearchView import androidx.core.view.MenuItemCompat import androidx.core.view.doOnNextLayout +import androidx.drawerlayout.widget.DrawerLayout import androidx.recyclerview.widget.* import androidx.room.Room import androidx.work.Constraints @@ -48,23 +50,28 @@ import apps.amine.bou.readerforselfoss.utils.longHash import apps.amine.bou.readerforselfoss.utils.network.isNetworkAccessible import apps.amine.bou.readerforselfoss.utils.persistence.toEntity import apps.amine.bou.readerforselfoss.utils.persistence.toView -import co.zsmb.materialdrawerkt.builders.accountHeader -import co.zsmb.materialdrawerkt.builders.drawer -import co.zsmb.materialdrawerkt.builders.footer -import co.zsmb.materialdrawerkt.draweritems.badgeable.primaryItem -import co.zsmb.materialdrawerkt.draweritems.profile.profile import com.ashokvarma.bottomnavigation.BottomNavigationBar import com.ashokvarma.bottomnavigation.BottomNavigationItem import com.ashokvarma.bottomnavigation.TextBadgeItem import com.bumptech.glide.Glide import com.ftinc.scoop.Scoop import com.mikepenz.aboutlibraries.LibsBuilder -import com.mikepenz.materialdrawer.Drawer import com.mikepenz.materialdrawer.holder.BadgeStyle +import com.mikepenz.materialdrawer.holder.ColorHolder import com.mikepenz.materialdrawer.holder.StringHolder import com.mikepenz.materialdrawer.model.DividerDrawerItem import com.mikepenz.materialdrawer.model.PrimaryDrawerItem +import com.mikepenz.materialdrawer.model.ProfileDrawerItem import com.mikepenz.materialdrawer.model.SecondaryDrawerItem +import com.mikepenz.materialdrawer.model.interfaces.badgeRes +import com.mikepenz.materialdrawer.model.interfaces.badgeText +import com.mikepenz.materialdrawer.model.interfaces.iconDrawable +import com.mikepenz.materialdrawer.model.interfaces.iconRes +import com.mikepenz.materialdrawer.model.interfaces.nameRes +import com.mikepenz.materialdrawer.model.interfaces.nameText +import com.mikepenz.materialdrawer.util.addStickyFooterItem +import com.mikepenz.materialdrawer.util.updateBadge +import com.mikepenz.materialdrawer.widget.AccountHeaderView import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -116,7 +123,6 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener { private lateinit var tabNewBadge: TextBadgeItem private lateinit var tabArchiveBadge: TextBadgeItem private lateinit var tabStarredBadge: TextBadgeItem - private lateinit var drawer: Drawer private lateinit var api: SelfossApi private lateinit var customTabActivityHelper: CustomTabActivityHelper private lateinit var editor: SharedPreferences.Editor @@ -166,6 +172,11 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener { handleThemeBinding() setSupportActionBar(binding.toolBar) + supportActionBar!!.setDisplayHomeAsUpEnabled(true) + supportActionBar!!.setHomeButtonEnabled(true) + val mDrawerToggle = ActionBarDrawerToggle(this, binding.drawerContainer, binding.toolBar, R.string.material_drawer_open, R.string.material_drawer_close) + binding.drawerContainer.addDrawerListener(mDrawerToggle) + mDrawerToggle.syncState() db = Room.databaseBuilder( applicationContext, @@ -446,61 +457,69 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener { } private fun handleDrawer() { + val drawerListener = object : DrawerLayout.DrawerListener { + override fun onDrawerSlide(drawerView: View, slideOffset: Float) { + } + + override fun onDrawerOpened(drawerView: View) { + binding.bottomBar.hide() + } + + override fun onDrawerClosed(drawerView: View) { + binding.bottomBar.show() + } + + override fun onDrawerStateChanged(newState: Int) { + } + + } + + binding.drawerContainer.addDrawerListener(drawerListener) + displayAccountHeader = PreferenceManager.getDefaultSharedPreferences(this) .getBoolean("account_header_displaying", false) - drawer = drawer { - rootViewRes = R.id.drawer_layout - toolbar = binding.toolBar - actionBarDrawerToggleEnabled = true - actionBarDrawerToggleAnimated = true - showOnFirstLaunch = true - onSlide { _, p1 -> - binding.bottomBar.alpha = (1 - p1) - } - onClosed { - binding.bottomBar.show() - } - onOpened { - binding.bottomBar.hide() - } - - if (displayAccountHeader) { - accountHeader { - background = R.drawable.bg - profile(settings.getString("url", "")!!) { - iconDrawable = resources.getDrawable(R.mipmap.ic_launcher) - } - selectionListEnabledForSingleProfile = false + binding.mainDrawer.addStickyFooterItem( + PrimaryDrawerItem().apply { + nameRes = R.string.drawer_report_bug + iconRes = R.drawable.ic_bug_report_black_24dp + isIconTinted = true + onDrawerItemClickListener = { _, _, _ -> + val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(Config.trackerUrl)) + startActivity(browserIntent) + false } - } + }) - footer { - primaryItem(R.string.drawer_report_bug) { - icon = R.drawable.ic_bug_report_black_24dp - iconTintingEnabled = true - onClick { _ -> - val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(Config.trackerUrl)) - startActivity(browserIntent) - false - } + binding.mainDrawer.addStickyFooterItem( + PrimaryDrawerItem().apply { + nameRes = R.string.title_activity_settings + iconRes = R.drawable.ic_settings_black_24dp + isIconTinted = true + onDrawerItemClickListener = { _, _, _ -> + startActivityForResult( + Intent( + this@HomeActivity, + SettingsActivity::class.java + ), + MENU_PREFERENCES + ) + false } + }) - primaryItem(R.string.title_activity_settings) { - icon = R.drawable.ic_settings_black_24dp - iconTintingEnabled = true - onClick { _ -> - startActivityForResult( - Intent( - this@HomeActivity, - SettingsActivity::class.java - ), - MENU_PREFERENCES - ) - false + if (displayAccountHeader) { + AccountHeaderView(this).apply { + attachToSliderView(binding.mainDrawer) + addProfiles( + ProfileDrawerItem().apply { + nameText = settings.getString("url", "").toString() + background = resources.getDrawable(R.drawable.bg) + iconRes = R.mipmap.ic_launcher + selectionListEnabledForSingleProfile = false } - } + ) } } } @@ -511,10 +530,9 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener { fun handleTags(maybeTags: List?) { if (maybeTags == null) { if (loadedFromCache) { - drawer.addItem( + binding.mainDrawer.itemAdapter.add( SecondaryDrawerItem() - .withName(getString(R.string.drawer_error_loading_tags)) - .withSelectable(false) + .apply { nameRes = R.string.drawer_error_loading_tags; isSelectable = false } ) } } else { @@ -523,39 +541,38 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener { .sortedBy { it.unread == 0 } tagsBadge = filteredTags.map { val gd = GradientDrawable() - val color = try { + val gdColor = try { Color.parseColor(it.color) } catch (e: IllegalArgumentException) { appColors.colorPrimary } - gd.setColor(color) + gd.setColor(gdColor) gd.shape = GradientDrawable.RECTANGLE gd.setSize(30, 30) gd.cornerRadius = 30F - var drawerItem = + val drawerItem = PrimaryDrawerItem() - .withName(it.tag) - .withIdentifier(it.tag.longHash()) - .withIcon(gd) - .withBadgeStyle( - BadgeStyle().withTextColor(Color.WHITE) - .withColor(appColors.colorAccent) - ) - .withOnDrawerItemClickListener { _, _, _ -> - allItems = ArrayList() - maybeTagFilter = it - SharedItems.tagFilter = it.tag - getElementsAccordingToTab() - fetchOnEmptyList() - false - } + .apply { + nameText = it.getTitleDecoded() + identifier = it.tag.longHash() + iconDrawable = gd + badgeStyle = BadgeStyle().apply { + textColor = ColorHolder.fromColor(Color.WHITE) + color = ColorHolder.fromColor(appColors.colorAccent) } + onDrawerItemClickListener = { _,_,_ -> + allItems = ArrayList() + maybeTagFilter = it + SharedItems.tagFilter = it.tag + getElementsAccordingToTab() + fetchOnEmptyList() + false + } } if (it.unread > 0) { - drawerItem = drawerItem.withBadge("${it.unread}") + drawerItem.badgeText = it.unread.toString() } - drawer.addItem( - drawerItem - ) + + binding.mainDrawer.itemAdapter.add(drawerItem) (it.tag.longHash() to it.unread) }.toMap() @@ -565,10 +582,11 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener { fun handleHiddenTags(maybeTags: List?) { if (maybeTags == null) { if (loadedFromCache) { - drawer.addItem( - SecondaryDrawerItem() - .withName(getString(R.string.drawer_error_loading_tags)) - .withSelectable(false) + binding.mainDrawer.itemAdapter.add( + SecondaryDrawerItem().apply { + nameRes = R.string.drawer_error_loading_tags + isSelectable = false + } ) } } else { @@ -576,39 +594,37 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener { maybeTags.filter { hiddenTags.contains(it.tag) } tagsBadge = filteredHiddenTags.map { val gd = GradientDrawable() - val color = try { + val gdColor = try { Color.parseColor(it.color) } catch (e: IllegalArgumentException) { appColors.colorPrimary } - gd.setColor(color) + gd.setColor(gdColor) gd.shape = GradientDrawable.RECTANGLE gd.setSize(30, 30) gd.cornerRadius = 30F - var drawerItem = - PrimaryDrawerItem() - .withName(it.tag) - .withIdentifier(it.tag.longHash()) - .withIcon(gd) - .withBadgeStyle( - BadgeStyle().withTextColor(Color.WHITE) - .withColor(appColors.colorAccent) - ) - .withOnDrawerItemClickListener { _, _, _ -> + val drawerItem = + PrimaryDrawerItem().apply { + nameText = it.getTitleDecoded() + identifier = it.tag.longHash() + iconDrawable = gd + badgeStyle = BadgeStyle().apply { + textColor = ColorHolder.fromColor(Color.WHITE) + color = ColorHolder.fromColor(appColors.colorAccent) } + onDrawerItemClickListener = { _,_,_ -> allItems = ArrayList() maybeTagFilter = it SharedItems.tagFilter = it.tag getElementsAccordingToTab() fetchOnEmptyList() false - } + } } + if (it.unread > 0) { - drawerItem = drawerItem.withBadge("${it.unread}") + drawerItem.badgeText = it.unread.toString() } - drawer.addItem( - drawerItem - ) + binding.mainDrawer.itemAdapter.add(drawerItem) (it.tag.longHash() to it.unread) }.toMap() @@ -618,51 +634,52 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener { fun handleSources(maybeSources: List?) { if (maybeSources == null) { if (loadedFromCache) { - drawer.addItem( - SecondaryDrawerItem() - .withName(getString(R.string.drawer_error_loading_sources)) - .withSelectable(false) + binding.mainDrawer.itemAdapter.add( + SecondaryDrawerItem().apply { + nameRes = R.string.drawer_error_loading_sources + isSelectable = false + } ) } } else { - for (tag in maybeSources) { - val item = PrimaryDrawerItem() - .withName(tag.getTitleDecoded()) - .withIdentifier(tag.id.toLong()) - .withOnDrawerItemClickListener { _, _, _ -> - allItems = ArrayList() - maybeSourceFilter = tag - SharedItems.sourceIDFilter = tag.id.toLong() - SharedItems.sourceFilter = tag.title - getElementsAccordingToTab() - fetchOnEmptyList() - false - } - if (tag.getIcon(this@HomeActivity).isNotBlank()) { + for (source in maybeSources) { + val item = PrimaryDrawerItem().apply { + nameText = source.getTitleDecoded() + identifier = source.id.toLong() + onDrawerItemClickListener = { _,_,_ -> + allItems = ArrayList() + maybeSourceFilter = source + SharedItems.sourceIDFilter = source.id.toLong() + SharedItems.sourceFilter = source.title + getElementsAccordingToTab() + fetchOnEmptyList() + false + } + } + if (source.getIcon(this@HomeActivity).isNotBlank()) { thread { try { - item.withIcon(BitmapDrawable(resources, Glide.with(this@HomeActivity).asBitmap().load(tag.getIcon(this@HomeActivity)).submit(100, 100).get())) + item.iconDrawable = BitmapDrawable(resources, Glide.with(this@HomeActivity).asBitmap().load(source.getIcon(this@HomeActivity)).submit(100, 100).get()) } catch (e: Exception) { } } } else { - item.withIcon(R.mipmap.ic_launcher) + item.iconRes = R.mipmap.ic_launcher } - drawer.addItem(item) - + binding.mainDrawer.itemAdapter.add(item) } } } - drawer.removeAllItems() + binding.mainDrawer.itemAdapter.clear() if (maybeDrawerData != null) { - drawer.addItem( - SecondaryDrawerItem() - .withName(getString(R.string.drawer_item_filters)) - .withSelectable(false) - .withIdentifier(DRAWER_ID_FILTERS) - .withBadge(getString(R.string.drawer_action_clear)) - .withOnDrawerItemClickListener { _, _, _ -> + binding.mainDrawer.itemAdapter.add( + SecondaryDrawerItem().apply { + nameRes = R.string.drawer_item_filters + isSelectable = false + identifier = DRAWER_ID_FILTERS + badgeRes = R.string.drawer_action_clear + onDrawerItemClickListener = { _,_,_ -> allItems = ArrayList() maybeSourceFilter = null SharedItems.sourceFilter = null @@ -673,55 +690,59 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener { fetchOnEmptyList() false } + } ) if (hiddenTags.isNotEmpty()) { - drawer.addItem(DividerDrawerItem()) - drawer.addItem( - SecondaryDrawerItem() - .withName(getString(R.string.drawer_item_hidden_tags)) - .withIdentifier(DRAWER_ID_HIDDEN_TAGS) - .withSelectable(false) + binding.mainDrawer.itemAdapter.add( + DividerDrawerItem(), + SecondaryDrawerItem().apply { + nameRes = R.string.drawer_item_hidden_tags + identifier = DRAWER_ID_HIDDEN_TAGS + isSelectable = false + } ) handleHiddenTags(maybeDrawerData.tags) } - drawer.addItem(DividerDrawerItem()) - drawer.addItem( - SecondaryDrawerItem() - .withName(getString(R.string.drawer_item_tags)) - .withIdentifier(DRAWER_ID_TAGS) - .withSelectable(false) + binding.mainDrawer.itemAdapter.add( + DividerDrawerItem(), + SecondaryDrawerItem().apply { + nameRes = R.string.drawer_item_tags + identifier = DRAWER_ID_TAGS + isSelectable = false + } ) handleTags(maybeDrawerData.tags) - drawer.addItem(DividerDrawerItem()) - drawer.addItem( - SecondaryDrawerItem() - .withName(getString(R.string.drawer_item_sources)) - .withIdentifier(DRAWER_ID_TAGS) - .withBadge(getString(R.string.drawer_action_edit)) - .withSelectable(false) - .withOnDrawerItemClickListener { _, _, _ -> - startActivity(Intent(this, SourcesActivity::class.java)) + binding.mainDrawer.itemAdapter.add( + DividerDrawerItem(), + SecondaryDrawerItem().apply { + nameRes = R.string.drawer_item_sources + identifier = DRAWER_ID_SOURCES + isSelectable = false + badgeRes = R.string.drawer_action_edit + onDrawerItemClickListener = { v,_,_ -> + startActivity(Intent(v!!.context, SourcesActivity::class.java)) false } + } ) handleSources(maybeDrawerData.sources) - drawer.addItem(DividerDrawerItem()) - drawer.addItem( - PrimaryDrawerItem() - .withName(R.string.action_about) - .withSelectable(false) - .withIcon(R.drawable.ic_info_outline_white_24dp) - .withIconTintingEnabled(true) - .withOnDrawerItemClickListener { _, _, _ -> + binding.mainDrawer.itemAdapter.add( + DividerDrawerItem(), + PrimaryDrawerItem().apply { + nameRes = R.string.action_about + isSelectable = false + iconRes = R.drawable.ic_info_outline_white_24dp + isIconTinted = true + onDrawerItemClickListener = { _,_,_ -> LibsBuilder() .withAboutIconShown(true) .withAboutVersionShown(true) .start(this@HomeActivity) false } + } ) - if (!loadedFromCache) { if (maybeDrawerData.tags != null) { thread { @@ -741,17 +762,17 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener { } } else { if (!loadedFromCache) { - drawer.addItem( - PrimaryDrawerItem() - .withName(getString(R.string.no_tags_loaded)) - .withIdentifier(DRAWER_ID_TAGS) - .withSelectable(false) - ) - drawer.addItem( - PrimaryDrawerItem() - .withName(getString(R.string.no_sources_loaded)) - .withIdentifier(DRAWER_ID_SOURCES) - .withSelectable(false) + binding.mainDrawer.itemAdapter.add( + PrimaryDrawerItem().apply { + nameRes = R.string.no_tags_loaded + identifier = DRAWER_ID_TAGS + isSelectable = false + }, + PrimaryDrawerItem().apply { + nameRes = R.string.no_sources_loaded + identifier = DRAWER_ID_SOURCES + isSelectable = false + } ) } } @@ -802,14 +823,15 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener { } } - drawer.addItem( - PrimaryDrawerItem().withName(getString(R.string.drawer_loading)).withSelectable( - false - ) + binding.mainDrawer.itemAdapter.add( + PrimaryDrawerItem().apply { + nameRes = R.string.drawer_loading + isSelectable = false + } ) thread { - var drawerData = DrawerData(db.drawerDataDao().tags().map { it.toView() }, + val drawerData = DrawerData(db.drawerDataDao().tags().map { it.toView() }, db.drawerDataDao().sources().map { it.toView() }) runOnUiThread { handleDrawerData(drawerData, loadedFromCache = true) @@ -1095,9 +1117,9 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener { private fun reloadTagsBadges() { tagsBadge.forEach { - drawer.updateBadge(it.key, StringHolder("${it.value}")) + binding.mainDrawer.updateBadge(it.key, StringHolder(it.value.toString())) } - drawer.resetDrawerContent() + binding.mainDrawer.resetDrawerContent() } private fun calculateNoOfColumns(): Int { @@ -1127,7 +1149,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener { override fun onActivityResult(req: Int, result: Int, data: Intent?) { when (req) { MENU_PREFERENCES -> { - drawer.closeDrawer() + //drawer.closeDrawer() recreate() } else -> super.onActivityResult(req, result, data) diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/MyApp.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/MyApp.kt index 9974916..1414b74 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/MyApp.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/MyApp.kt @@ -60,23 +60,18 @@ class MyApp : MultiDexApplication() { private fun initDrawerImageLoader() { DrawerImageLoader.init(object : AbstractDrawerImageLoader() { - override fun set( - imageView: ImageView?, - uri: Uri?, - placeholder: Drawable?, - tag: String? - ) { + override fun set(imageView: ImageView, uri: Uri, placeholder: Drawable, tag: String?) { Glide.with(imageView?.context) .loadMaybeBasicAuth(config, uri.toString()) .apply(RequestOptions.fitCenterTransform().placeholder(placeholder)) .into(imageView) } - override fun cancel(imageView: ImageView?) { + override fun cancel(imageView: ImageView) { Glide.with(imageView?.context).clear(imageView) } - override fun placeholder(ctx: Context?, tag: String?): Drawable { + override fun placeholder(ctx: Context, tag: String?): Drawable { return baseContext.resources.getDrawable(R.mipmap.ic_launcher) } }) diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/api/selfoss/SelfossModels.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/api/selfoss/SelfossModels.kt index 18caa15..8e0d919 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/api/selfoss/SelfossModels.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/api/selfoss/SelfossModels.kt @@ -30,7 +30,11 @@ data class Tag( @SerializedName("tag") val tag: String, @SerializedName("color") val color: String, @SerializedName("unread") val unread: Int -) +) { + fun getTitleDecoded(): String { + return Html.fromHtml(tag).toString() + } +} class SuccessResponse(@SerializedName("success") val success: Boolean) { val isSuccess: Boolean diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/themes/AppColors.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/themes/AppColors.kt index 8626770..85edf56 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/themes/AppColors.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/themes/AppColors.kt @@ -59,9 +59,9 @@ class AppColors(a: Activity) { } textColor = if (isDarkTheme) { - R.color.md_white_1000 + R.color.white } else { - R.color.md_grey_900 + R.color.grey_900 } val wrapper = Context::class.java diff --git a/app/src/main/res/layout/activity_home.xml b/app/src/main/res/layout/activity_home.xml index c4fdfe6..fc2a0d6 100644 --- a/app/src/main/res/layout/activity_home.xml +++ b/app/src/main/res/layout/activity_home.xml @@ -1,7 +1,8 @@ - - - + android:layout_height="match_parent" + android:orientation="vertical" + android:background="?android:attr/windowBackground"> - + android:layout_height="wrap_content" + android:gravity="center_horizontal" + android:paddingTop="100dp" + android:text="@string/nothing_here" + android:textAlignment="center" + android:textAppearance="@style/TextAppearance.AppCompat.Headline" + android:background="@android:color/transparent" + android:visibility="gone" /> - + + - - + - - - @@ -90,4 +83,11 @@ android:layout_width="match_parent" android:layout_height="60dp"/> - \ No newline at end of file + + + \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index fab61fb..4cbc3ba 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -4,30 +4,34 @@ @drawable/background_splash - - @@ -35,7 +39,6 @@