Skip to content

Commit

Permalink
Merge pull request #127 from arunkumar9t2/develop
Browse files Browse the repository at this point in the history
Release 2.1.2
  • Loading branch information
arunkumar9t2 authored Sep 29, 2019
2 parents 1c13984 + 129040f commit 891a123
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 28 deletions.
4 changes: 2 additions & 2 deletions android-app/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ android {
applicationId "arun.com.chromer"
minSdkVersion 16
targetSdkVersion 28
versionCode 54
versionName "2.1.1"
versionCode 55
versionName "2.1.2"

multiDexEnabled true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -14,13 +15,22 @@ import kotlinx.android.synthetic.main.widget_tab_model_preview.*
abstract class TabModel : KotlinEpoxyModelWithHolder<TabModel.ViewHolder>() {
@EpoxyAttribute
lateinit var tab: TabsManager.Tab
@EpoxyAttribute(DoNotHash)
lateinit var tabsManager: TabsManager

override fun bind(holder: ViewHolder) {
super.bind(holder)
GlideApp.with(holder.containerView.context)
.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()
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -21,29 +22,16 @@ abstract class TabsInfoModel : KotlinEpoxyModelWithHolder<TabsInfoModel.ViewHold
@EpoxyAttribute(DoNotHash)
lateinit var tabsManager: TabsManager

private var init = false

override fun bind(holder: ViewHolder) {
super.bind(holder)
holder.tabsDescription.text = holder.tabsDescription.context.resources.getQuantityString(
R.plurals.active_tabs,
tabs.size,
tabs.size
)
holder.containerView.setOnClickListener {
holder.tabsCard.setOnClickListener {
tabsManager.showTabsActivity()
}
if (!init) {
holder.tabsPreviewRecyclerView.apply {
(itemAnimator as? DefaultItemAnimator)?.supportsChangeAnimations = false
layoutManager = LinearLayoutManager(
holder.containerView.context,
RecyclerView.HORIZONTAL,
false
)
}
init = true
}
if (tabs.isEmpty()) {
holder.tabsPreviewRecyclerView.gone()
} else {
Expand All @@ -53,11 +41,24 @@ abstract class TabsInfoModel : KotlinEpoxyModelWithHolder<TabsInfoModel.ViewHold
tab {
id(tab.hashCode())
tab(tab)
tabsManager(tabsManager)
}
}
}
}
}

class ViewHolder : KotlinHolder()
class ViewHolder : KotlinHolder() {
override fun bindView(itemView: View) {
super.bindView(itemView)
tabsPreviewRecyclerView.apply {
(itemAnimator as? DefaultItemAnimator)?.supportsChangeAnimations = false
layoutManager = LinearLayoutManager(
containerView.context,
RecyclerView.HORIZONTAL,
false
)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ class WebsiteDecoder(private val context: Context, glide: Glide) : ResourceDecod
Color.parseColor("#EC4E20"),
Color.parseColor("#6EEB83"),
Color.parseColor("#29335C"),
Color.parseColor("#BDE4A8"),
Color.parseColor("#A491D3")
Color.parseColor("#BDE4A8")
)

override fun handles(source: Website, options: Options): Boolean = true
Expand Down
24 changes: 18 additions & 6 deletions android-app/app/src/main/res/layout/layout_tabs_info_card.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tabsCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="4dp"
android:layout_marginRight="8dp"
android:clickable="true"
android:focusable="true"
app:cardPreventCornerOverlap="true"
app:cardUseCompatPadding="true">

Expand Down Expand Up @@ -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"
Expand All @@ -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" />

<TextView
android:id="@+id/tabsButton"
style="@style/FeedBorderlessButton"
android:layout_height="0dp"
android:paddingStart="8dp"
android:paddingLeft="8dp"
android:text="@string/title_tabs"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

Expand Down
4 changes: 4 additions & 0 deletions android-app/app/src/main/res/values/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ a {
<body>
<strong>You can view this again in the About screen.</strong>
<br></br>
<strong>2.1.2</strong>
<ul>
<li><b>FIX: </b> Clear text communication error.</li>
</ul>
<strong>2.1.1</strong>
<ul>
<li><b>FIX: </b> Open/Search with Lynket option not using selected search engine</li>
Expand Down
4 changes: 2 additions & 2 deletions android-app/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
<style name="FeedBorderlessButton">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginEnd">16dp</item>
<item name="android:layout_marginRight">16dp</item>
<item name="android:paddingRight">16dp</item>
<item name="android:paddingEnd">16dp</item>
<item name="android:background">?attr/selectableItemBackgroundBorderless</item>
<item name="android:gravity">center</item>
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Button</item>
Expand Down
5 changes: 4 additions & 1 deletion android-app/app/src/main/res/xml/network_security_config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<network-security-config xmlns:tools="http://schemas.android.com/tools">
<base-config
cleartextTrafficPermitted="true"
tools:ignore="InsecureBaseConfiguration" />
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">suggestqueries.google.com</domain>
</domain-config>
Expand Down

0 comments on commit 891a123

Please sign in to comment.