mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-01-29 16:49:16 +01:00
redesigning New Conversation screen
This commit is contained in:
parent
c6ca168dc9
commit
e4a7253b87
@ -16,6 +16,7 @@ import com.simplemobiletools.smsmessenger.adapters.ContactsAdapter
|
||||
import com.simplemobiletools.smsmessenger.extensions.getSuggestedContacts
|
||||
import com.simplemobiletools.smsmessenger.extensions.getThreadId
|
||||
import com.simplemobiletools.smsmessenger.helpers.*
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.activity_new_conversation.*
|
||||
import kotlinx.android.synthetic.main.item_suggested_contact.view.*
|
||||
import java.net.URLDecoder
|
||||
@ -26,11 +27,15 @@ class NewConversationActivity : SimpleActivity() {
|
||||
private var privateContacts = ArrayList<SimpleContact>()
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
isMaterialActivity = true
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_new_conversation)
|
||||
title = getString(R.string.new_conversation)
|
||||
updateTextColors(new_conversation_holder)
|
||||
|
||||
updateMaterialActivityViews(new_conversation_coordinator, contacts_list, true)
|
||||
setupMaterialScrollListener(contacts_list, new_conversation_toolbar)
|
||||
|
||||
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
|
||||
new_conversation_address.requestFocus()
|
||||
|
||||
@ -45,6 +50,7 @@ class NewConversationActivity : SimpleActivity() {
|
||||
setupToolbar(new_conversation_toolbar, NavigationIcon.Arrow)
|
||||
no_contacts_placeholder_2.setTextColor(getProperPrimaryColor())
|
||||
no_contacts_placeholder_2.underlineText()
|
||||
suggestions_label.setTextColor(getProperPrimaryColor())
|
||||
}
|
||||
|
||||
private fun initContacts() {
|
||||
|
@ -5,151 +5,139 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/new_conversation_app_bar_layout"
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/new_conversation_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/new_conversation_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@color/color_primary"
|
||||
app:title="@string/new_conversation"
|
||||
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@color/color_primary"
|
||||
app:title="@string/new_conversation"
|
||||
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/new_conversation_nested_scrollview"
|
||||
android:id="@+id/new_conversation_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
android:layout_marginTop="?attr/actionBarSize">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/new_conversation_holder"
|
||||
<com.simplemobiletools.commons.views.MyEditText
|
||||
android:id="@+id/new_conversation_address"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="@dimen/normal_icon_size"
|
||||
android:layout_marginStart="@dimen/activity_margin"
|
||||
android:layout_marginEnd="@dimen/activity_margin"
|
||||
android:layout_toStartOf="@+id/new_conversation_confirm"
|
||||
android:background="@android:color/transparent"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="@string/add_contact_or_number"
|
||||
android:inputType="textCapWords"
|
||||
android:textSize="@dimen/big_text_size" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyEditText
|
||||
android:id="@+id/new_conversation_address"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/normal_icon_size"
|
||||
android:layout_marginStart="@dimen/activity_margin"
|
||||
android:layout_marginEnd="@dimen/activity_margin"
|
||||
android:layout_toStartOf="@+id/new_conversation_confirm"
|
||||
android:background="@android:color/transparent"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="@string/add_contact_or_number"
|
||||
android:inputType="textCapWords"
|
||||
android:textSize="@dimen/big_text_size" />
|
||||
<ImageView
|
||||
android:id="@+id/new_conversation_confirm"
|
||||
android:layout_width="@dimen/normal_icon_size"
|
||||
android:layout_height="@dimen/normal_icon_size"
|
||||
android:layout_alignTop="@+id/new_conversation_address"
|
||||
android:layout_alignBottom="@+id/new_conversation_address"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:padding="@dimen/medium_margin"
|
||||
android:src="@drawable/ic_check_vector"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/new_conversation_confirm"
|
||||
android:layout_width="@dimen/normal_icon_size"
|
||||
android:layout_height="@dimen/normal_icon_size"
|
||||
android:layout_alignTop="@+id/new_conversation_address"
|
||||
android:layout_alignBottom="@+id/new_conversation_address"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:padding="@dimen/medium_margin"
|
||||
android:src="@drawable/ic_check_vector"
|
||||
android:visibility="gone" />
|
||||
<ImageView
|
||||
android:id="@+id/add_contact_divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/divider_height"
|
||||
android:layout_below="@+id/new_conversation_address"
|
||||
android:background="@color/divider_grey" />
|
||||
|
||||
<View
|
||||
android:id="@+id/message_divider_two"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:layout_below="@+id/new_conversation_address"
|
||||
android:background="@color/divider_grey"
|
||||
android:importantForAccessibility="no" />
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/no_contacts_placeholder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/suggestions_scrollview"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/bigger_margin"
|
||||
android:alpha="0.8"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin"
|
||||
android:text="@string/no_access_to_contacts"
|
||||
android:textSize="@dimen/bigger_text_size"
|
||||
android:textStyle="italic"
|
||||
android:visibility="gone" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/no_contacts_placeholder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/suggestions_scrollview"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/bigger_margin"
|
||||
android:alpha="0.8"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin"
|
||||
android:text="@string/no_access_to_contacts"
|
||||
android:textSize="@dimen/bigger_text_size"
|
||||
android:textStyle="italic"
|
||||
android:visibility="gone" />
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/no_contacts_placeholder_2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/no_contacts_placeholder"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/ripple_all_corners"
|
||||
android:gravity="center"
|
||||
android:padding="@dimen/activity_margin"
|
||||
android:text="@string/request_the_required_permissions"
|
||||
android:textSize="@dimen/bigger_text_size"
|
||||
android:visibility="gone" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/no_contacts_placeholder_2"
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/suggestions_label"
|
||||
style="@style/MaterialSectionLabelStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/add_contact_divider"
|
||||
android:layout_marginStart="@dimen/activity_margin"
|
||||
android:layout_marginBottom="@dimen/medium_margin"
|
||||
android:text="@string/suggestions"
|
||||
android:textSize="@dimen/normal_text_size" />
|
||||
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/suggestions_scrollview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/suggestions_label"
|
||||
android:layout_marginBottom="@dimen/medium_margin"
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="none">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/suggestions_holder"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/no_contacts_placeholder"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/ripple_all_corners"
|
||||
android:gravity="center"
|
||||
android:padding="@dimen/activity_margin"
|
||||
android:text="@string/request_the_required_permissions"
|
||||
android:textSize="@dimen/bigger_text_size"
|
||||
android:visibility="gone" />
|
||||
android:divider="@drawable/linear_layout_horizontal_divider"
|
||||
android:orientation="horizontal"
|
||||
android:showDividers="middle" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/suggestions_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/message_divider_two"
|
||||
android:alpha="0.8"
|
||||
android:padding="@dimen/activity_margin"
|
||||
android:text="@string/suggestions"
|
||||
android:textSize="@dimen/normal_text_size" />
|
||||
</HorizontalScrollView>
|
||||
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/suggestions_scrollview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/suggestions_label"
|
||||
android:layout_marginBottom="@dimen/medium_margin"
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="none">
|
||||
<com.simplemobiletools.commons.views.MyRecyclerView
|
||||
android:id="@+id/contacts_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/suggestions_scrollview"
|
||||
android:clipToPadding="false"
|
||||
android:layoutAnimation="@anim/layout_animation"
|
||||
android:overScrollMode="ifContentScrolls"
|
||||
android:scrollbars="none"
|
||||
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/suggestions_holder"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:divider="@drawable/linear_layout_horizontal_divider"
|
||||
android:orientation="horizontal"
|
||||
android:showDividers="middle" />
|
||||
</HorizontalScrollView>
|
||||
<com.reddit.indicatorfastscroll.FastScrollerView
|
||||
android:id="@+id/contacts_letter_fastscroller"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@+id/contacts_list"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:paddingTop="@dimen/big_margin"
|
||||
android:paddingBottom="@dimen/big_margin" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyRecyclerView
|
||||
android:id="@+id/contacts_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/suggestions_scrollview"
|
||||
android:clipToPadding="false"
|
||||
android:layoutAnimation="@anim/layout_animation"
|
||||
android:overScrollMode="ifContentScrolls"
|
||||
android:scrollbars="none"
|
||||
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager" />
|
||||
<com.reddit.indicatorfastscroll.FastScrollerThumbView
|
||||
android:id="@+id/contacts_letter_fastscroller_thumb"
|
||||
android:layout_width="@dimen/fab_size"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignTop="@+id/contacts_letter_fastscroller"
|
||||
android:layout_alignBottom="@+id/contacts_letter_fastscroller"
|
||||
android:layout_marginEnd="@dimen/activity_margin"
|
||||
android:layout_toStartOf="@+id/contacts_letter_fastscroller" />
|
||||
|
||||
<com.reddit.indicatorfastscroll.FastScrollerView
|
||||
android:id="@+id/contacts_letter_fastscroller"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@+id/contacts_list"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:paddingTop="@dimen/big_margin"
|
||||
android:paddingBottom="@dimen/big_margin" />
|
||||
|
||||
<com.reddit.indicatorfastscroll.FastScrollerThumbView
|
||||
android:id="@+id/contacts_letter_fastscroller_thumb"
|
||||
android:layout_width="@dimen/fab_size"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignTop="@+id/contacts_letter_fastscroller"
|
||||
android:layout_alignBottom="@+id/contacts_letter_fastscroller"
|
||||
android:layout_marginEnd="@dimen/activity_margin"
|
||||
android:layout_toStartOf="@+id/contacts_letter_fastscroller" />
|
||||
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
Loading…
x
Reference in New Issue
Block a user