Skip to content
Snippets Groups Projects
Commit fbc28c73 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Further improved channel list

- improved layout and colors
- automatically updating for even more events
parent d24a27df
No related branches found
No related tags found
No related merge requests found
......@@ -89,9 +89,9 @@ android {
}
val appCompatVersion = "27.0.2"
val appArchVersion = "1.0.0"
val appArchVersion = "1.1.0"
dependencies {
implementation(kotlin("stdlib", "1.2.0"))
implementation(kotlin("stdlib", "1.2.21"))
implementation(appCompat("appcompat-v7"))
implementation(appCompat("design"))
......@@ -100,18 +100,17 @@ dependencies {
implementation(appCompat("recyclerview-v7"))
implementation(appCompat("constraint", "constraint-layout", version = "1.0.2"))
implementation("com.github.StephenVinouze.AdvancedRecyclerView", "core", "1.1.6")
implementation("io.reactivex.rxjava2", "rxjava", "2.1.3")
implementation("io.reactivex.rxjava2", "rxjava", "2.1.9")
implementation(appArch("lifecycle", "extensions"))
implementation(appArch("lifecycle", "reactivestreams"))
kapt(appArch("lifecycle", "compiler"))
implementation(appArch("persistence.room", "runtime"))
kapt(appArch("persistence.room", "compiler"))
implementation(appArch("persistence.room", "runtime", "1.0.0"))
implementation(appArch("persistence.room", "rxjava2", "1.0.0"))
kapt(appArch("persistence.room", "compiler", "1.0.0"))
implementation(appArch("paging", "runtime", version = "1.0.0-alpha3")) {
implementation(appArch("paging", "runtime", version = "1.0.0-alpha5")) {
exclude(group = "junit", module = "junit")
}
......@@ -127,7 +126,7 @@ dependencies {
}
implementation(project(":malheur"))
testImplementation(appArch("persistence.room", "testing"))
testImplementation(appArch("persistence.room", "testing", "1.0.0"))
testImplementation("junit", "junit", "4.12")
androidTestImplementation("com.android.support.test", "runner", "1.0.1")
......
......@@ -170,6 +170,11 @@ class BufferListAdapter(
var bufferId: BufferId? = null
var networkId: NetworkId? = null
private var none: Int = 0
private var activity: Int = 0
private var message: Int = 0
private var highlight: Int = 0
init {
ButterKnife.bind(this, itemView)
itemView.setOnClickListener {
......@@ -183,6 +188,16 @@ class BufferListAdapter(
if (network != null)
expansionListener?.invoke(network)
}
itemView.context.theme.styledAttributes(
R.attr.colorTextSecondary, R.attr.colorTintActivity, R.attr.colorTintMessage,
R.attr.colorTintHighlight
) {
none = getColor(0, 0)
activity = getColor(1, 0)
message = getColor(2, 0)
highlight = getColor(3, 0)
}
}
override fun bind(props: BufferProps, state: BufferState) {
......@@ -190,6 +205,15 @@ class BufferListAdapter(
bufferId = props.info.bufferId
networkId = props.info.networkId
name.setTextColor(
when (props.activity) {
Buffer_Activity.NoActivity -> none
Buffer_Activity.OtherActivity -> activity
Buffer_Activity.NewMessage -> message
Buffer_Activity.Highlight -> highlight
}
)
if (state.networkExpanded) {
status.setImageDrawable(itemView.context.getCompatDrawable(R.drawable.ic_chevron_up))
} else {
......@@ -234,7 +258,7 @@ class BufferListAdapter(
itemView.context.theme.styledAttributes(
R.attr.colorAccent, R.attr.colorAway,
R.attr.colorForeground, R.attr.colorTintActivity, R.attr.colorTintMessage,
R.attr.colorTextPrimary, R.attr.colorTintActivity, R.attr.colorTintMessage,
R.attr.colorTintHighlight
) {
DrawableCompat.setTint(online, getColor(0, 0))
......@@ -313,7 +337,7 @@ class BufferListAdapter(
itemView.context.theme.styledAttributes(
R.attr.colorAccent, R.attr.colorAway,
R.attr.colorForeground, R.attr.colorTintActivity, R.attr.colorTintMessage,
R.attr.colorTextPrimary, R.attr.colorTintActivity, R.attr.colorTintMessage,
R.attr.colorTintHighlight
) {
DrawableCompat.setTint(online, getColor(0, 0))
......@@ -394,7 +418,7 @@ class BufferListAdapter(
itemView.context.theme.styledAttributes(
R.attr.colorAccent, R.attr.colorAway,
R.attr.colorForeground, R.attr.colorTintActivity, R.attr.colorTintMessage,
R.attr.colorTextPrimary, R.attr.colorTintActivity, R.attr.colorTintMessage,
R.attr.colorTintHighlight
) {
DrawableCompat.setTint(online, getColor(0, 0))
......
......@@ -81,11 +81,10 @@ class BufferViewConfigFragment : ServiceBoundFragment() {
bufferIdList.switchMapRx { ids ->
val bufferSyncer = manager.bufferSyncer
if (bufferSyncer != null) {
bufferSyncer.live_bufferInfos.switchMap {
Observable.combineLatest(
ids.mapNotNull { id ->
manager.bufferSyncer?.bufferInfo(
id
)
bufferSyncer.bufferInfo(id)
}.mapNotNull {
val network = manager.networks[it.networkId]
if (network == null) {
......@@ -167,6 +166,7 @@ class BufferViewConfigFragment : ServiceBoundFragment() {
array.toList() as List<BufferListAdapter.BufferProps>
}
)
}
} else {
Observable.empty()
}
......
......@@ -35,7 +35,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:singleLine="true"
android:textColor="?attr/colorForeground"
android:textColor="?attr/colorTextPrimary"
android:textSize="13sp"
android:textStyle="bold"
tools:text="#quasseldroid" />
......@@ -46,7 +46,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:singleLine="true"
android:textColor="?attr/colorForegroundSecondary"
android:textColor="?attr/colorTextSecondary"
android:textSize="12sp"
tools:text="QuasselDroid is an Android client for #quassel ♥ justJanne's much improved version: https://dl.kuschku.de/releases/quasseldroid/ ♥ http://github.com/sandsmark/QuasselDroid ♥ Quasseldroid on play https://market.android.com/details?id=com.iskrembilen.quasseldroid ♥ Sign up for beta: https://plus.google.com/communities/104094956084217666662" />
</LinearLayout>
......
......@@ -4,11 +4,21 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?attr/selectableItemBackgroundBorderless"
android:minHeight="48dp"
android:background="?attr/selectableItemBackground"
android:orientation="vertical"
tools:background="@android:color/background_light"
tools:theme="@style/Theme.ChatTheme.Quassel_Light">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/colorDivider" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="48dp">
<TextView
android:id="@+id/name"
android:layout_width="0dip"
......@@ -20,7 +30,7 @@
android:layout_marginTop="8dp"
android:layout_weight="1"
android:singleLine="true"
android:textColor="?attr/colorForeground"
android:textColor="?attr/colorTextSecondary"
android:textSize="14sp"
android:textStyle="bold"
tools:text="Freenode" />
......@@ -29,12 +39,17 @@
android:id="@+id/status"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="Expand"
android:focusable="true"
android:minWidth="72dp"
android:paddingBottom="12dp"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingTop="12dp"
android:scaleType="fitEnd"
android:tint="?attr/colorForegroundSecondary"
android:tint="?attr/colorTextSecondary"
app:srcCompat="@drawable/ic_chevron_down" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -44,6 +44,8 @@
<attr name="colorForegroundMirc" format="integer" />
<attr name="colorTextPrimary" format="color" />
<attr name="colorTextSecondary" format="color" />
<attr name="colorDivider" format="color" />
<attr name="colorBackground" format="color" />
......
......@@ -40,6 +40,8 @@
<item name="windowActionModeOverlay">true</item>
<item name="colorTextPrimary">#8a8a8a</item>
<item name="colorTextSecondary">#dedede</item>
<item name="colorDivider">#1FFFFFFF</item>
<item name="colorFill">@color/colorFillDark</item>
......@@ -74,6 +76,8 @@
<item name="windowActionModeOverlay">true</item>
<item name="colorTextPrimary">#212121</item>
<item name="colorTextSecondary">#757575</item>
<item name="colorDivider">#1F000000</item>>
<item name="colorFill">@color/colorFillLight</item>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment