adding a main screen button launching the dialer

This commit is contained in:
tibbi 2018-09-22 20:39:10 +02:00
parent ee51d9cf61
commit 31fae0b97c
3 changed files with 21 additions and 0 deletions

View file

@ -3,6 +3,7 @@ package com.simplemobiletools.contacts.activities
import android.app.SearchManager
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.graphics.drawable.Drawable
import android.net.Uri
@ -163,6 +164,10 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
}
}
isFirstResume = false
val blackIcon = resources.getColoredDrawableWithColor(R.drawable.ic_phone_big, if (isBlackAndWhiteTheme()) Color.BLACK else Color.WHITE)
main_dialer_button.setImageDrawable(blackIcon)
main_dialer_button.background.applyColorFilter(getAdjustedPrimaryColor())
}
override fun onPause() {
@ -369,6 +374,10 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
}
main_tabs_holder.beVisibleIf(skippedTabs < 3)
main_dialer_button.setOnClickListener {
}
}
private fun getTabIcon(position: Int): Drawable {

View file

@ -22,4 +22,15 @@
android:layout_height="match_parent"
android:layout_below="@+id/main_tabs_holder"/>
<ImageView
android:id="@+id/main_dialer_button"
android:layout_width="@dimen/dialer_button_size"
android:layout_height="@dimen/dialer_button_size"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/activity_margin"
android:background="@drawable/circle_background"
android:padding="@dimen/normal_margin"
android:src="@drawable/ic_phone_big"/>
</RelativeLayout>

View file

@ -4,4 +4,5 @@
<dimen name="contact_actions_size">45dp</dimen>
<dimen name="contact_icons_size">40dp</dimen>
<dimen name="contact_item_height">52dp</dimen>
<dimen name="dialer_button_size">60dp</dimen>
</resources>