forked from upstream-mirrors/quik
Set up UI and click events for Drawer
This commit is contained in:
+7
-3
@@ -17,6 +17,7 @@ import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.presentation.base.QkActivity
|
||||
import com.moez.QKSMS.presentation.messages.MessageListActivity
|
||||
import kotlinx.android.synthetic.main.conversation_list_activity.*
|
||||
import kotlinx.android.synthetic.main.drawer_view.*
|
||||
import kotlinx.android.synthetic.main.toolbar.*
|
||||
import timber.log.Timber
|
||||
|
||||
@@ -38,9 +39,12 @@ class ConversationListActivity : QkActivity(), Observer<ConversationListViewStat
|
||||
conversationList.layoutManager = LinearLayoutManager(this)
|
||||
|
||||
swipeRefresh.setOnRefreshListener { viewModel.onRefresh() }
|
||||
RxView.clicks(compose).subscribe {
|
||||
// TODO: add entry point to compose view here
|
||||
}
|
||||
RxView.clicks(compose).subscribe { }
|
||||
RxView.clicks(drawer).subscribe { }
|
||||
RxView.clicks(archived).subscribe { }
|
||||
RxView.clicks(scheduled).subscribe { }
|
||||
RxView.clicks(blocked).subscribe { }
|
||||
RxView.clicks(settings).subscribe { }
|
||||
}
|
||||
|
||||
override fun onNewIntent(intent: Intent?) {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM4,12c0,-4.42 3.58,-8 8,-8 1.85,0 3.55,0.63 4.9,1.69L5.69,16.9C4.63,15.55 4,13.85 4,12zM12,20c-1.85,0 -3.55,-0.63 -4.9,-1.69L18.31,7.1C19.37,8.45 20,10.15 20,12c0,4.42 -3.58,8 -8,8z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M17,12h-5v5h5v-5zM16,1v2L8,3L8,1L6,1v2L5,3c-1.11,0 -1.99,0.9 -1.99,2L3,19c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2h-1L18,1h-2zM19,19L5,19L5,8h14v11z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M10,4H4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V8c0,-1.1 -0.9,-2 -2,-2h-8l-2,-2z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z"/>
|
||||
</vector>
|
||||
@@ -56,12 +56,19 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
<FrameLayout
|
||||
android:id="@+id/drawer"
|
||||
android:layout_width="320dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical" />
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
layout="@layout/drawer_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</android.support.v4.widget.DrawerLayout>
|
||||
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingTop="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/archived"
|
||||
style="@style/DrawerRow">
|
||||
|
||||
<ImageView
|
||||
style="@style/DrawerIcon"
|
||||
android:src="@drawable/ic_folder_black_24dp" />
|
||||
|
||||
<TextView
|
||||
style="@style/DrawerText"
|
||||
android:text="@string/drawer_archived" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/scheduled"
|
||||
style="@style/DrawerRow">
|
||||
|
||||
<ImageView
|
||||
style="@style/DrawerIcon"
|
||||
android:src="@drawable/ic_event_black_24dp" />
|
||||
|
||||
<TextView
|
||||
style="@style/DrawerText"
|
||||
android:text="@string/drawer_scheduled" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/blocked"
|
||||
style="@style/DrawerRow">
|
||||
|
||||
<ImageView
|
||||
style="@style/DrawerIcon"
|
||||
android:src="@drawable/ic_block_black_24dp" />
|
||||
|
||||
<TextView
|
||||
style="@style/DrawerText"
|
||||
android:text="@string/drawer_blocked" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@color/list_separator" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/settings"
|
||||
style="@style/DrawerRow">
|
||||
|
||||
<ImageView
|
||||
style="@style/DrawerIcon"
|
||||
android:src="@drawable/ic_settings_black_24dp" />
|
||||
|
||||
<TextView
|
||||
style="@style/DrawerText"
|
||||
android:text="@string/drawer_settings" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -4,6 +4,11 @@
|
||||
|
||||
<string name="compose_hint">Write a message</string>
|
||||
|
||||
<string name="drawer_archived">Archived</string>
|
||||
<string name="drawer_scheduled">Scheduled</string>
|
||||
<string name="drawer_blocked">Blocked</string>
|
||||
<string name="drawer_settings">Settings</string>
|
||||
|
||||
<string name="notification_reply">Reply</string>
|
||||
<string name="notification_read">Mark read</string>
|
||||
|
||||
|
||||
@@ -26,4 +26,30 @@
|
||||
<item name="android:textSize">12sp</item>
|
||||
</style>
|
||||
|
||||
<style name="DrawerRow">
|
||||
<item name="android:layout_height">48dp</item>
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:background">?android:attr/selectableItemBackground</item>
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="android:paddingStart">16dp</item>
|
||||
<item name="android:paddingEnd">16dp</item>
|
||||
</style>
|
||||
|
||||
<style name="DrawerText">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_width">0dp</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
<item name="android:lines">1</item>
|
||||
<item name="android:textColor">@color/textPrimary</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
|
||||
<style name="DrawerIcon">
|
||||
<item name="android:layout_height">24dp</item>
|
||||
<item name="android:layout_width">24dp</item>
|
||||
<item name="android:layout_marginEnd">32dp</item>
|
||||
<item name="android:tint">@color/textSecondary</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user