diff options
author | Allan Wang <me@allanwang.ca> | 2019-09-15 00:33:22 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2019-09-15 00:33:22 -0700 |
commit | 509aca4c2c40f9418ae8866be5ba9f3fb4428d90 (patch) | |
tree | b85a808f3c84fe6915a5fec0d9ab8ce1d0dc3329 /app/src/main/kotlin/com/pitchedapps/frost/iitems | |
parent | 5071a44197cdc3b7ad4a2c3d188fcfd205f32449 (diff) | |
download | frost-509aca4c2c40f9418ae8866be5ba9f3fb4428d90.tar.gz frost-509aca4c2c40f9418ae8866be5ba9f3fb4428d90.tar.bz2 frost-509aca4c2c40f9418ae8866be5ba9f3fb4428d90.zip |
Remove auth and native ui elements by default
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/iitems')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/iitems/MenuIItem.kt | 87 | ||||
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/iitems/NotificationIItem.kt | 2 |
2 files changed, 0 insertions, 89 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/iitems/MenuIItem.kt b/app/src/main/kotlin/com/pitchedapps/frost/iitems/MenuIItem.kt deleted file mode 100644 index ee0cd94c..00000000 --- a/app/src/main/kotlin/com/pitchedapps/frost/iitems/MenuIItem.kt +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2018 Allan Wang - * - * 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 <http://www.gnu.org/licenses/>. - */ -package com.pitchedapps.frost.iitems - -import android.view.View -import android.view.ViewGroup -import android.widget.ImageView -import android.widget.TextView -import ca.allanwang.kau.iitems.KauIItem -import ca.allanwang.kau.ui.createSimpleRippleDrawable -import ca.allanwang.kau.utils.bindView -import ca.allanwang.kau.utils.gone -import ca.allanwang.kau.utils.visible -import com.mikepenz.fastadapter.FastAdapter -import com.pitchedapps.frost.R -import com.pitchedapps.frost.facebook.requests.MenuFooterItem -import com.pitchedapps.frost.facebook.requests.MenuHeader -import com.pitchedapps.frost.facebook.requests.MenuItem -import com.pitchedapps.frost.glide.FrostGlide -import com.pitchedapps.frost.glide.GlideApp -import com.pitchedapps.frost.utils.Prefs - -/** - * Created by Allan Wang on 30/12/17. - */ -class MenuContentIItem(val data: MenuItem) : - KauIItem<MenuContentIItem, MenuContentIItem.ViewHolder>(R.layout.iitem_menu, ::ViewHolder), - ClickableIItemContract { - - override val url: String? - get() = data.url - - class ViewHolder(itemView: View) : FastAdapter.ViewHolder<MenuContentIItem>(itemView) { - - val frame: ViewGroup by bindView(R.id.item_frame) - val icon: ImageView by bindView(R.id.item_icon) - val content: TextView by bindView(R.id.item_content) - val badge: TextView by bindView(R.id.item_badge) - - override fun bindView(item: MenuContentIItem, payloads: MutableList<Any>) { - frame.background = createSimpleRippleDrawable(Prefs.textColor, Prefs.nativeBgColor) - content.setTextColor(Prefs.textColor) - badge.setTextColor(Prefs.textColor) - val iconUrl = item.data.pic - if (iconUrl != null) - GlideApp.with(itemView) - .load(iconUrl) - .transform(FrostGlide.circleCrop) - .into(icon.visible()) - else - icon.gone() - content.text = item.data.name - badge.text = item.data.badge - } - - override fun unbindView(item: MenuContentIItem) { - GlideApp.with(itemView).clear(icon) - content.text = null - badge.text = null - } - } -} - -class MenuHeaderIItem(val data: MenuHeader) : HeaderIItem( - data.header, - itemId = R.id.item_menu_header -) - -class MenuFooterIItem(val data: MenuFooterItem) : - TextIItem(data.name, data.url, R.id.item_menu_footer) - -class MenuFooterSmallIItem(val data: MenuFooterItem) : - TextIItem(data.name, data.url, R.id.item_menu_footer_small) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/iitems/NotificationIItem.kt b/app/src/main/kotlin/com/pitchedapps/frost/iitems/NotificationIItem.kt index cfbb928b..1806d351 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/iitems/NotificationIItem.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/iitems/NotificationIItem.kt @@ -34,7 +34,6 @@ import com.pitchedapps.frost.facebook.FbItem import com.pitchedapps.frost.facebook.parsers.FrostNotif import com.pitchedapps.frost.glide.FrostGlide import com.pitchedapps.frost.glide.GlideApp -import com.pitchedapps.frost.services.FrostRunnable import com.pitchedapps.frost.utils.Prefs import com.pitchedapps.frost.utils.isIndependent import com.pitchedapps.frost.utils.launchWebOverlay @@ -53,7 +52,6 @@ class NotificationIItem(val notification: FrostNotif, val cookie: String) : .withOnClickListener { v, _, item, position -> val notif = item.notification if (notif.unread) { - FrostRunnable.markNotificationRead(v!!.context, notif.id, item.cookie) adapter.set( position, NotificationIItem(notif.copy(unread = false), item.cookie) |