From b00a1af8da86044694a6f7a422c97f1afafed1b2 Mon Sep 17 00:00:00 2001 From: Arunkumar Date: Sun, 29 Sep 2019 14:47:50 +0800 Subject: [PATCH 1/3] [FIX] Enable app wide clear text --- android-app/app/src/main/res/xml/network_security_config.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/android-app/app/src/main/res/xml/network_security_config.xml b/android-app/app/src/main/res/xml/network_security_config.xml index bdb181c3..ab2c078d 100644 --- a/android-app/app/src/main/res/xml/network_security_config.xml +++ b/android-app/app/src/main/res/xml/network_security_config.xml @@ -1,5 +1,8 @@ - + + suggestqueries.google.com From a7c56be1eb632832ac6bab164ab586726d65111c Mon Sep 17 00:00:00 2001 From: Arunkumar Date: Sun, 29 Sep 2019 15:05:44 +0800 Subject: [PATCH 2/3] [FIX] Tabs card design changes --- .../home/epoxycontroller/model/TabModel.kt | 10 ++++++ .../epoxycontroller/model/TabsInfoModel.kt | 31 ++++++++++--------- .../util/glide/favicon/WebsiteDecoder.kt | 3 +- .../main/res/layout/layout_tabs_info_card.xml | 24 ++++++++++---- .../app/src/main/res/values/styles.xml | 4 +-- 5 files changed, 47 insertions(+), 25 deletions(-) diff --git a/android-app/app/src/main/java/arun/com/chromer/home/epoxycontroller/model/TabModel.kt b/android-app/app/src/main/java/arun/com/chromer/home/epoxycontroller/model/TabModel.kt index 94be98bf..dea1fa30 100644 --- a/android-app/app/src/main/java/arun/com/chromer/home/epoxycontroller/model/TabModel.kt +++ b/android-app/app/src/main/java/arun/com/chromer/home/epoxycontroller/model/TabModel.kt @@ -5,6 +5,7 @@ import arun.com.chromer.data.website.model.Website import arun.com.chromer.tabs.TabsManager import arun.com.chromer.util.glide.GlideApp import com.airbnb.epoxy.EpoxyAttribute +import com.airbnb.epoxy.EpoxyAttribute.Option.DoNotHash import com.airbnb.epoxy.EpoxyModelClass import dev.arunkumar.android.epoxy.model.KotlinEpoxyModelWithHolder import dev.arunkumar.android.epoxy.model.KotlinHolder @@ -14,6 +15,8 @@ import kotlinx.android.synthetic.main.widget_tab_model_preview.* abstract class TabModel : KotlinEpoxyModelWithHolder() { @EpoxyAttribute lateinit var tab: TabsManager.Tab + @EpoxyAttribute(DoNotHash) + lateinit var tabsManager: TabsManager override fun bind(holder: ViewHolder) { super.bind(holder) @@ -21,6 +24,13 @@ abstract class TabModel : KotlinEpoxyModelWithHolder() { .load(tab.website ?: Website(tab.url)) .circleCrop() .into(holder.icon) + holder.containerView.setOnClickListener { + tabsManager.reOrderTabByUrl( + holder.containerView.context, + Website(tab.url), + listOf(tab.getTargetActivityName()) + ) + } } class ViewHolder : KotlinHolder() diff --git a/android-app/app/src/main/java/arun/com/chromer/home/epoxycontroller/model/TabsInfoModel.kt b/android-app/app/src/main/java/arun/com/chromer/home/epoxycontroller/model/TabsInfoModel.kt index fe6caee2..b18133c8 100644 --- a/android-app/app/src/main/java/arun/com/chromer/home/epoxycontroller/model/TabsInfoModel.kt +++ b/android-app/app/src/main/java/arun/com/chromer/home/epoxycontroller/model/TabsInfoModel.kt @@ -1,5 +1,6 @@ package arun.com.chromer.home.epoxycontroller.model +import android.view.View import androidx.recyclerview.widget.DefaultItemAnimator import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView @@ -21,8 +22,6 @@ abstract class TabsInfoModel : KotlinEpoxyModelWithHolder @@ -44,7 +43,7 @@ android:gravity="center|start" android:textColor="@color/primary_text_color" app:layout_constraintBottom_toTopOf="@+id/tabsPreviewRecyclerView" - app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintEnd_toStartOf="@id/tabsButton" app:layout_constraintHorizontal_bias="0.5" app:layout_constraintStart_toEndOf="@+id/tabsIcon" app:layout_constraintTop_toTopOf="parent" @@ -61,13 +60,26 @@ android:foregroundGravity="left" android:orientation="horizontal" android:visibility="gone" - app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintEnd_toStartOf="@id/tabsButton" app:layout_constraintStart_toEndOf="@+id/tabsIcon" app:layout_constraintTop_toBottomOf="@+id/tabsDescription" tools:itemCount="8" - tools:listitem="@layout/widget_tab_model_preview" /> + tools:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" + tools:listitem="@layout/widget_tab_model_preview" + tools:visibility="visible" /> + + diff --git a/android-app/app/src/main/res/values/styles.xml b/android-app/app/src/main/res/values/styles.xml index bb84dfb9..9c520d06 100644 --- a/android-app/app/src/main/res/values/styles.xml +++ b/android-app/app/src/main/res/values/styles.xml @@ -138,8 +138,8 @@