Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.

[UPDATE] Added different icon for technical article. #111

Merged
merged 2 commits into from
Jun 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
187 changes: 0 additions & 187 deletions .idea/assetWizardSettings.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ data class ResourceInfo(
var url: String = "",
var publish_date: Timestamp? = null,
/**
* Possible values
* "blog", "techtalk"
* Possible values:
* "techarticle", "techtalk"
*/
var type: String = "techtalk"
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ResourceListAdapter(
parent, false
)

binding.actionPlay.setOnClickListener {
binding.actionPreviewResource.setOnClickListener {
binding.data?.let {
itemClickCallback?.invoke(it)
}
Expand Down
20 changes: 20 additions & 0 deletions app/src/main/res/drawable/ic_library_books_black_42dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!--
~ Copyright (c) 2019 Hossain Khan
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<vector android:height="42dp" android:viewportHeight="24.0"
android:viewportWidth="24.0" android:width="42dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M4,6L2,6v14c0,1.1 0.9,2 2,2h14v-2L4,20L4,6zM20,2L8,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM19,11L9,11L9,9h10v2zM15,15L9,15v-2h6v2zM19,7L9,7L9,5h10v2z"/>
</vector>
15 changes: 9 additions & 6 deletions app/src/main/res/layout/list_item_resource_tech_talk.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,17 @@
tools:background="#ccc">

<ImageButton
android:id="@+id/action_play"
android:id="@+id/action_preview_resource"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:tint="@color/md_red_500"
android:src="@{safeUnbox(data.youTubeUrl)? @drawable/ic_play_circle_filled_black_42dp : @drawable/ic_library_books_black_42dp}"
android:tint="@{safeUnbox(data.youTubeUrl)? @color/md_red_500 : @color/md_cyan_800}"
app:layout_constraintStart_toStartOf="@+id/guideline_vertical_start"
app:layout_constraintTop_toTopOf="@+id/resource_title"
app:srcCompat="@drawable/ic_play_circle_filled_black_42dp" />
tools:ignore="ContentDescription"
tools:src="@drawable/ic_play_circle_filled_black_42dp"
tools:tint="@color/md_red_500" />

<TextView
android:id="@+id/resource_summary"
Expand Down Expand Up @@ -71,12 +74,12 @@
android:id="@+id/resource_title"
style="@style/TextAppearance.AppCompat.Title"
android:layout_width="0dp"
android:gravity="end"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/material_vertical_margin"
android:gravity="end"
android:text="@{data.title}"
app:layout_constraintEnd_toEndOf="@id/guideline_vertical_end"
app:layout_constraintStart_toEndOf="@id/action_play"
app:layout_constraintStart_toEndOf="@id/action_preview_resource"
app:layout_constraintTop_toTopOf="parent"
tools:text="This is the title of the talk. This can become multi line" />

Expand All @@ -90,7 +93,7 @@
android:gravity="end"
android:text="@{@string/tech_talk_author_and_venue(data.author, data.event)}"
app:layout_constraintEnd_toEndOf="@id/guideline_vertical_end"
app:layout_constraintStart_toEndOf="@+id/action_play"
app:layout_constraintStart_toEndOf="@+id/action_preview_resource"
app:layout_constraintTop_toBottomOf="@+id/resource_title"
tools:text="by Author of the talk." />

Expand Down