Skip to content

Commit 891a123

Browse files
authored
Merge pull request #127 from arunkumar9t2/develop
Release 2.1.2
2 parents 1c13984 + 129040f commit 891a123

File tree

8 files changed

+57
-28
lines changed

8 files changed

+57
-28
lines changed

android-app/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ android {
5353
applicationId "arun.com.chromer"
5454
minSdkVersion 16
5555
targetSdkVersion 28
56-
versionCode 54
57-
versionName "2.1.1"
56+
versionCode 55
57+
versionName "2.1.2"
5858

5959
multiDexEnabled true
6060

android-app/app/src/main/java/arun/com/chromer/home/epoxycontroller/model/TabModel.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import arun.com.chromer.data.website.model.Website
55
import arun.com.chromer.tabs.TabsManager
66
import arun.com.chromer.util.glide.GlideApp
77
import com.airbnb.epoxy.EpoxyAttribute
8+
import com.airbnb.epoxy.EpoxyAttribute.Option.DoNotHash
89
import com.airbnb.epoxy.EpoxyModelClass
910
import dev.arunkumar.android.epoxy.model.KotlinEpoxyModelWithHolder
1011
import dev.arunkumar.android.epoxy.model.KotlinHolder
@@ -14,13 +15,22 @@ import kotlinx.android.synthetic.main.widget_tab_model_preview.*
1415
abstract class TabModel : KotlinEpoxyModelWithHolder<TabModel.ViewHolder>() {
1516
@EpoxyAttribute
1617
lateinit var tab: TabsManager.Tab
18+
@EpoxyAttribute(DoNotHash)
19+
lateinit var tabsManager: TabsManager
1720

1821
override fun bind(holder: ViewHolder) {
1922
super.bind(holder)
2023
GlideApp.with(holder.containerView.context)
2124
.load(tab.website ?: Website(tab.url))
2225
.circleCrop()
2326
.into(holder.icon)
27+
holder.containerView.setOnClickListener {
28+
tabsManager.reOrderTabByUrl(
29+
holder.containerView.context,
30+
Website(tab.url),
31+
listOf(tab.getTargetActivityName())
32+
)
33+
}
2434
}
2535

2636
class ViewHolder : KotlinHolder()

android-app/app/src/main/java/arun/com/chromer/home/epoxycontroller/model/TabsInfoModel.kt

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package arun.com.chromer.home.epoxycontroller.model
22

3+
import android.view.View
34
import androidx.recyclerview.widget.DefaultItemAnimator
45
import androidx.recyclerview.widget.LinearLayoutManager
56
import androidx.recyclerview.widget.RecyclerView
@@ -21,29 +22,16 @@ abstract class TabsInfoModel : KotlinEpoxyModelWithHolder<TabsInfoModel.ViewHold
2122
@EpoxyAttribute(DoNotHash)
2223
lateinit var tabsManager: TabsManager
2324

24-
private var init = false
25-
2625
override fun bind(holder: ViewHolder) {
2726
super.bind(holder)
2827
holder.tabsDescription.text = holder.tabsDescription.context.resources.getQuantityString(
2928
R.plurals.active_tabs,
3029
tabs.size,
3130
tabs.size
3231
)
33-
holder.containerView.setOnClickListener {
32+
holder.tabsCard.setOnClickListener {
3433
tabsManager.showTabsActivity()
3534
}
36-
if (!init) {
37-
holder.tabsPreviewRecyclerView.apply {
38-
(itemAnimator as? DefaultItemAnimator)?.supportsChangeAnimations = false
39-
layoutManager = LinearLayoutManager(
40-
holder.containerView.context,
41-
RecyclerView.HORIZONTAL,
42-
false
43-
)
44-
}
45-
init = true
46-
}
4735
if (tabs.isEmpty()) {
4836
holder.tabsPreviewRecyclerView.gone()
4937
} else {
@@ -53,11 +41,24 @@ abstract class TabsInfoModel : KotlinEpoxyModelWithHolder<TabsInfoModel.ViewHold
5341
tab {
5442
id(tab.hashCode())
5543
tab(tab)
44+
tabsManager(tabsManager)
5645
}
5746
}
5847
}
5948
}
6049
}
6150

62-
class ViewHolder : KotlinHolder()
51+
class ViewHolder : KotlinHolder() {
52+
override fun bindView(itemView: View) {
53+
super.bindView(itemView)
54+
tabsPreviewRecyclerView.apply {
55+
(itemAnimator as? DefaultItemAnimator)?.supportsChangeAnimations = false
56+
layoutManager = LinearLayoutManager(
57+
containerView.context,
58+
RecyclerView.HORIZONTAL,
59+
false
60+
)
61+
}
62+
}
63+
}
6364
}

android-app/app/src/main/java/arun/com/chromer/util/glide/favicon/WebsiteDecoder.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ class WebsiteDecoder(private val context: Context, glide: Glide) : ResourceDecod
4949
Color.parseColor("#EC4E20"),
5050
Color.parseColor("#6EEB83"),
5151
Color.parseColor("#29335C"),
52-
Color.parseColor("#BDE4A8"),
53-
Color.parseColor("#A491D3")
52+
Color.parseColor("#BDE4A8")
5453
)
5554

5655
override fun handles(source: Website, options: Options): Boolean = true

android-app/app/src/main/res/layout/layout_tabs_info_card.xml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
5+
android:id="@+id/tabsCard"
56
android:layout_width="match_parent"
67
android:layout_height="wrap_content"
78
android:layout_marginLeft="8dp"
89
android:layout_marginTop="4dp"
910
android:layout_marginRight="8dp"
10-
android:clickable="true"
11-
android:focusable="true"
1211
app:cardPreventCornerOverlap="true"
1312
app:cardUseCompatPadding="true">
1413

@@ -44,7 +43,7 @@
4443
android:gravity="center|start"
4544
android:textColor="@color/primary_text_color"
4645
app:layout_constraintBottom_toTopOf="@+id/tabsPreviewRecyclerView"
47-
app:layout_constraintEnd_toEndOf="parent"
46+
app:layout_constraintEnd_toStartOf="@id/tabsButton"
4847
app:layout_constraintHorizontal_bias="0.5"
4948
app:layout_constraintStart_toEndOf="@+id/tabsIcon"
5049
app:layout_constraintTop_toTopOf="parent"
@@ -61,13 +60,26 @@
6160
android:foregroundGravity="left"
6261
android:orientation="horizontal"
6362
android:visibility="gone"
64-
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
6563
app:layout_constraintBottom_toBottomOf="parent"
66-
app:layout_constraintEnd_toEndOf="parent"
64+
app:layout_constraintEnd_toStartOf="@id/tabsButton"
6765
app:layout_constraintStart_toEndOf="@+id/tabsIcon"
6866
app:layout_constraintTop_toBottomOf="@+id/tabsDescription"
6967
tools:itemCount="8"
70-
tools:listitem="@layout/widget_tab_model_preview" />
68+
tools:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
69+
tools:listitem="@layout/widget_tab_model_preview"
70+
tools:visibility="visible" />
71+
72+
<TextView
73+
android:id="@+id/tabsButton"
74+
style="@style/FeedBorderlessButton"
75+
android:layout_height="0dp"
76+
android:paddingStart="8dp"
77+
android:paddingLeft="8dp"
78+
android:text="@string/title_tabs"
79+
app:layout_constraintBottom_toBottomOf="parent"
80+
app:layout_constraintEnd_toEndOf="parent"
81+
app:layout_constraintHorizontal_bias="1.0"
82+
app:layout_constraintTop_toTopOf="parent" />
7183

7284
</androidx.constraintlayout.widget.ConstraintLayout>
7385

android-app/app/src/main/res/values/changelog.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ a {
3636
<body>
3737
<strong>You can view this again in the About screen.</strong>
3838
<br></br>
39+
<strong>2.1.2</strong>
40+
<ul>
41+
<li><b>FIX: </b> Clear text communication error.</li>
42+
</ul>
3943
<strong>2.1.1</strong>
4044
<ul>
4145
<li><b>FIX: </b> Open/Search with Lynket option not using selected search engine</li>

android-app/app/src/main/res/values/styles.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@
138138
<style name="FeedBorderlessButton">
139139
<item name="android:layout_width">wrap_content</item>
140140
<item name="android:layout_height">wrap_content</item>
141-
<item name="android:layout_marginEnd">16dp</item>
142-
<item name="android:layout_marginRight">16dp</item>
141+
<item name="android:paddingRight">16dp</item>
142+
<item name="android:paddingEnd">16dp</item>
143143
<item name="android:background">?attr/selectableItemBackgroundBorderless</item>
144144
<item name="android:gravity">center</item>
145145
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Button</item>

android-app/app/src/main/res/xml/network_security_config.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<network-security-config>
2+
<network-security-config xmlns:tools="http://schemas.android.com/tools">
3+
<base-config
4+
cleartextTrafficPermitted="true"
5+
tools:ignore="InsecureBaseConfiguration" />
36
<domain-config cleartextTrafficPermitted="true">
47
<domain includeSubdomains="true">suggestqueries.google.com</domain>
58
</domain-config>

0 commit comments

Comments
 (0)