Unverified Commit 9643a532 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito Committed by GitHub

Merge pull request #588 from filipedelimabrito/layout/spotlight

[WIP][LAYOUT][V2] Add spotlight to chat list screen.
parents 0e234c3f 729d61d8
......@@ -55,6 +55,8 @@ dependencies {
implementation libraries.kotlin
implementation libraries.floatingSearchView
testImplementation libraries.junit
androidTestImplementation (libraries.expressoCore , {
exclude group: 'com.android.support', module: 'support-annotations'
......
......@@ -20,7 +20,7 @@ class ChatListFragment : Fragment() {
showChatList(createDumpData())
}
// This is just a sample showing 6 chat rooms (aka user subscription). We need to get it rid in a real word. REMARK: remove this comment and this method.
// This is just a sample showing 8 chat rooms (aka user subscription). We need to get it rid in a real word. REMARK: remove this comment and this method.
private fun createDumpData(): List<Chat> {
val dumpChat1 = Chat("https://open.rocket.chat/avatar/leonardo.aramaki",
"Leonardo Aramaki",
......@@ -64,9 +64,23 @@ class ChatListFragment : Fragment() {
"Yes @sttyru, but you'll need to implement from the ground up following the docs at docs.rocket.chat where you can see the REST (HTTP) and Real-Time (WebSockets) calls.",
LocalDateTime.of(2017, 11, 14,1, 3),
0)
val dumpChat7 = Chat("https://open.rocket.chat/avatar/bestrun",
"androidnativeapp-2",
"c",
null,
"Just downloaded .zip and imported into Android Studio then build the project.",
LocalDateTime.of(2017, 11, 4,12, 47),
0)
val dumpChat8 = Chat("https://open.rocket.chat/avatar/3djc",
"iosnativeapp",
"c",
null,
"Ok, got confused by the blog announcement that shows a screenshot with github oAuth ! Sorry !",
LocalDateTime.of(2017, 11, 4,12, 43),
0)
// creates a list of chat sorted by lastMessageDateTime attribute.
return listOf(dumpChat1, dumpChat2, dumpChat3, dumpChat4, dumpChat5, dumpChat6).sortedByDescending { chat -> chat.lastMessageDateTime }
return listOf(dumpChat1, dumpChat2, dumpChat3, dumpChat4, dumpChat5, dumpChat6, dumpChat7, dumpChat8).sortedByDescending { chat -> chat.lastMessageDateTime }
}
// REMARK: The presenter should call this method. The presenter also need to sort the chat list by latest message (compared by its date).
......
......@@ -8,4 +8,5 @@
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
\ No newline at end of file
......@@ -2,10 +2,11 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@style/AuthenticationTheme">
android:theme="@style/AppTheme">
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@style/AppTheme">
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical" />
android:clipToPadding="false"
android:gravity="center_horizontal"
android:paddingTop="84dp" />
</LinearLayout>
\ No newline at end of file
<com.arlib.floatingsearchview.FloatingSearchView
android:id="@+id/floating_search_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:floatingSearch_close_search_on_keyboard_dismiss="true"
app:floatingSearch_dimBackground="false"
app:floatingSearch_dismissOnOutsideTouch="true"
app:floatingSearch_leftActionMode="showSearch"
app:floatingSearch_searchBarMarginLeft="4dp"
app:floatingSearch_searchBarMarginRight="4dp"
app:floatingSearch_searchBarMarginTop="28dp" />
</RelativeLayout>
\ No newline at end of file
......@@ -6,6 +6,8 @@
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="colorControlHighlight">@color/colorPrimary</item>
</style>
<style name="AuthenticationTheme" parent="android:Theme.Material.NoActionBar.Fullscreen">
......
......@@ -21,6 +21,7 @@ ext {
dagger : '2.11',
fresco : '1.5.0',
threeTenABP : '1.0.5',
floatingSearchView: '2.1.1',
// For testing
expresso : '3.0.1',
......@@ -55,6 +56,7 @@ ext {
frescoAnimatedWebP : "com.facebook.fresco:animated-webp:${versions.fresco}",
timber : "com.jakewharton.timber:timber:${versions.timber}",
threeTenABP : "com.jakewharton.threetenabp:threetenabp:${versions.threeTenABP}",
floatingSearchView : "com.github.arimorty:floatingsearchview:${versions.floatingSearchView}",
// For testing
junit : "junit:junit:$versions.junit",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment