start rewriting the Edit screen too

This commit is contained in:
tibbi 2020-10-26 16:07:10 +01:00
parent 9ad96061a9
commit 61f17de7f4
4 changed files with 507 additions and 492 deletions

View File

@ -103,7 +103,8 @@
<activity
android:name=".activities.EditContactActivity"
android:parentActivityName=".activities.MainActivity">
android:parentActivityName=".activities.MainActivity"
android:theme="@style/TranslucentTheme">
<intent-filter>
<action android:name="android.intent.action.EDIT"/>

View File

@ -5,15 +5,14 @@ import android.content.ClipData
import android.content.ContentValues
import android.content.Intent
import android.graphics.Bitmap
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.net.Uri
import android.os.Bundle
import android.provider.ContactsContract.CommonDataKinds
import android.provider.ContactsContract.CommonDataKinds.*
import android.provider.MediaStore
import android.view.Menu
import android.view.MenuItem
import android.view.ViewGroup
import android.view.WindowManager
import android.view.*
import android.widget.EditText
import android.widget.ImageView
import android.widget.TextView
@ -60,6 +59,7 @@ class EditContactActivity : ContactActivity() {
private var originalContactSource = ""
override fun onCreate(savedInstanceState: Bundle?) {
useDynamicTheme = false
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_edit_contact)
@ -67,6 +67,9 @@ class EditContactActivity : ContactActivity() {
return
}
contact_wrapper.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
contact_wrapper.background = ColorDrawable(config.backgroundColor)
val action = intent.action
isThirdPartyIntent = action == Intent.ACTION_EDIT || action == Intent.ACTION_INSERT || action == ADD_NEW_CONTACT_NUMBER
val isFromSimpleContacts = intent.getBooleanExtra(IS_FROM_SIMPLE_CONTACTS, false)
@ -91,6 +94,11 @@ class EditContactActivity : ContactActivity() {
}
}
override fun onResume() {
super.onResume()
window.statusBarColor = Color.TRANSPARENT
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.menu_edit_contact, menu)
if (wasActivityInitialized) {

File diff suppressed because it is too large Load Diff

View File

@ -59,8 +59,8 @@
android:layout_height="@dimen/contact_actions_size"
android:adjustViewBounds="true"
android:background="?attr/selectableItemBackgroundBorderless"
android:paddingLeft="@dimen/small_margin"
android:paddingRight="@dimen/small_margin"
android:paddingStart="@dimen/small_margin"
android:paddingEnd="@dimen/small_margin"
android:scaleType="fitCenter"
android:src="@drawable/ic_email_vector" />
@ -71,8 +71,8 @@
android:layout_marginStart="@dimen/normal_margin"
android:adjustViewBounds="true"
android:background="?attr/selectableItemBackgroundBorderless"
android:paddingLeft="@dimen/small_margin"
android:paddingRight="@dimen/small_margin"
android:paddingStart="@dimen/small_margin"
android:paddingEnd="@dimen/small_margin"
android:scaleType="fitCenter"
android:src="@drawable/ic_phone_vector" />
@ -83,8 +83,8 @@
android:layout_marginStart="@dimen/normal_margin"
android:adjustViewBounds="true"
android:background="?attr/selectableItemBackgroundBorderless"
android:paddingLeft="@dimen/small_margin"
android:paddingRight="@dimen/small_margin"
android:paddingStart="@dimen/small_margin"
android:paddingEnd="@dimen/small_margin"
android:scaleType="fitCenter"
android:src="@drawable/ic_sms_vector" />