mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-02-17 12:00:39 +01:00
start rewriting the View Contact screen with a bigger top image
This commit is contained in:
parent
a7b865775b
commit
d1ebf226cd
@ -57,7 +57,7 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.simplemobiletools:commons:5.31.8'
|
||||
implementation 'com.simplemobiletools:commons:5.31.9'
|
||||
implementation 'joda-time:joda-time:2.10.1'
|
||||
implementation 'com.googlecode.ez-vcard:ez-vcard:0.10.5'
|
||||
implementation 'com.github.tibbi:IndicatorFastScroll:08f512858a'
|
||||
|
@ -69,7 +69,8 @@
|
||||
<activity
|
||||
android:name=".activities.ViewContactActivity"
|
||||
android:label="@string/details"
|
||||
android:parentActivityName=".activities.MainActivity">
|
||||
android:parentActivityName=".activities.MainActivity"
|
||||
android:theme="@style/TranslucentTheme">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW"/>
|
||||
|
@ -550,7 +550,8 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
||||
FAQItem(R.string.faq_1_title, R.string.faq_1_text),
|
||||
FAQItem(R.string.faq_2_title_commons, R.string.faq_2_text_commons),
|
||||
FAQItem(R.string.faq_6_title_commons, R.string.faq_6_text_commons),
|
||||
FAQItem(R.string.faq_7_title_commons, R.string.faq_7_text_commons)
|
||||
FAQItem(R.string.faq_7_title_commons, R.string.faq_7_text_commons),
|
||||
FAQItem(R.string.faq_9_title_commons, R.string.faq_9_text_commons)
|
||||
)
|
||||
|
||||
startAboutActivity(R.string.app_name, licenses, BuildConfig.VERSION_NAME, faqItems, true)
|
||||
|
@ -1,10 +1,10 @@
|
||||
package com.simplemobiletools.contacts.pro.activities
|
||||
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.os.Bundle
|
||||
import android.provider.ContactsContract
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import android.widget.RelativeLayout
|
||||
@ -44,6 +44,7 @@ class ViewContactActivity : ContactActivity() {
|
||||
private val COMPARABLE_PHONE_NUMBER_LENGTH = 9
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
useDynamicTheme = false
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_view_contact)
|
||||
|
||||
@ -52,10 +53,14 @@ class ViewContactActivity : ContactActivity() {
|
||||
}
|
||||
|
||||
showFields = config.showContactFields
|
||||
contact_wrapper.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
contact_wrapper.background = ColorDrawable(config.backgroundColor)
|
||||
setupMenu()
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
window.statusBarColor = Color.TRANSPARENT
|
||||
isViewIntent = intent.action == ContactsContract.QuickContact.ACTION_QUICK_CONTACT || intent.action == Intent.ACTION_VIEW
|
||||
if (isViewIntent) {
|
||||
handlePermission(PERMISSION_READ_CONTACTS) {
|
||||
@ -83,28 +88,33 @@ class ViewContactActivity : ContactActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
menuInflater.inflate(R.menu.menu_view_contact, menu)
|
||||
menu.apply {
|
||||
findItem(R.id.open_with).isVisible = contact?.isPrivate() == false
|
||||
updateMenuItemColors(this)
|
||||
}
|
||||
return true
|
||||
}
|
||||
private fun setupMenu() {
|
||||
(activity_track_appbar.layoutParams as RelativeLayout.LayoutParams).topMargin = statusBarHeight
|
||||
activity_track_toolbar.menu.apply {
|
||||
findItem(R.id.share).setOnMenuItemClickListener {
|
||||
shareContact(fullContact!!)
|
||||
true
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
if (contact == null) {
|
||||
return true
|
||||
findItem(R.id.edit).setOnMenuItemClickListener {
|
||||
launchEditContact(contact!!)
|
||||
true
|
||||
}
|
||||
|
||||
findItem(R.id.open_with).setOnMenuItemClickListener {
|
||||
openWith()
|
||||
true
|
||||
}
|
||||
|
||||
findItem(R.id.delete).setOnMenuItemClickListener {
|
||||
deleteContactFromAllSources()
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
when (item.itemId) {
|
||||
R.id.edit -> launchEditContact(contact!!)
|
||||
R.id.share -> shareContact(fullContact!!)
|
||||
R.id.open_with -> openWith()
|
||||
R.id.delete -> deleteContactFromAllSources()
|
||||
else -> return super.onOptionsItemSelected(item)
|
||||
activity_track_toolbar.setNavigationOnClickListener {
|
||||
finish()
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
private fun initContact() {
|
||||
@ -203,7 +213,7 @@ class ViewContactActivity : ContactActivity() {
|
||||
contact_send_email.setOnClickListener { trySendEmail() }
|
||||
|
||||
updateTextColors(contact_scrollview)
|
||||
invalidateOptionsMenu()
|
||||
activity_track_toolbar.menu.findItem(R.id.open_with).isVisible = contact?.isPrivate() == false
|
||||
}
|
||||
|
||||
private fun setupViewContact() {
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/contact_wrapper"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
@ -438,4 +439,29 @@
|
||||
android:src="@drawable/img_write_storage"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/activity_track_top_shadow"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/top_shadow_height"
|
||||
android:layout_alignParentTop="true"
|
||||
android:background="@drawable/gradient_background_flipped"
|
||||
android:contentDescription="@null" />
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/activity_track_appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:background="@android:color/transparent"
|
||||
android:elevation="0dp"
|
||||
app:elevation="0dp">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/activity_track_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
app:menu="@menu/menu_view_contact"
|
||||
app:navigationIcon="@drawable/ic_arrow_left_vector" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
</RelativeLayout>
|
||||
|
Loading…
x
Reference in New Issue
Block a user