Skip to content

Commit

Permalink
add a label at the insert_or_edit activity
Browse files Browse the repository at this point in the history
  • Loading branch information
tibbi committed Sep 26, 2018
1 parent 5d8d0dd commit a7b79f8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.simplemobiletools.contacts.activities
import android.content.Intent
import android.os.Bundle
import android.provider.ContactsContract
import com.simplemobiletools.commons.extensions.getAdjustedPrimaryColor
import com.simplemobiletools.commons.extensions.getColoredDrawableWithColor
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.extensions.updateTextColors
Expand All @@ -17,15 +18,15 @@ class InsertOrEditContactActivity : SimpleActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_insert_edit_contact)
title = getString(R.string.select_contact)
updateTextColors(insert_edit_contact_holder)
setupViews()

handlePermission(PERMISSION_READ_CONTACTS) {
// we do not really care about the permission request result. Even if it was denied, load private contacts
setupViews()
}
}

private fun setupViews() {
updateTextColors(insert_edit_contact_holder)
new_contact_tmb.setImageDrawable(resources.getColoredDrawableWithColor(R.drawable.ic_new_contact, config.textColor))
new_contact_holder.setOnClickListener {
Intent().apply {
Expand All @@ -39,5 +40,7 @@ class InsertOrEditContactActivity : SimpleActivity() {
}
}
}

existing_contact_label.setTextColor(getAdjustedPrimaryColor())
}
}
12 changes: 12 additions & 0 deletions app/src/main/res/layout/activity_insert_edit_contact.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,16 @@
android:textSize="@dimen/big_text_size"/>

</RelativeLayout>

<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/existing_contact_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/new_contact_holder"
android:layout_marginStart="@dimen/bigger_margin"
android:layout_marginLeft="@dimen/bigger_margin"
android:text="@string/add_to_existing_contact"
android:textAllCaps="true"
android:textSize="@dimen/smaller_text_size"/>

</RelativeLayout>

0 comments on commit a7b79f8

Please sign in to comment.