Skip to content

Commit

Permalink
Fix #14
Browse files Browse the repository at this point in the history
  • Loading branch information
roeiedri committed May 17, 2019
1 parent a4aee21 commit 1ea87eb
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 16 deletions.
Expand Up @@ -243,20 +243,9 @@ public void removeOverlay(@NotNull ViewGroup view) {
mRejectButton.setOnTouchListener(mRejectLongClickListener);
mAnswerButton.setOnTouchListener(mAnswerLongClickListener);

//Hide all overlays
mActionTimerOverlay.setAlpha(0.0f);
mAnswerCallOverlay.setAlpha(0.0f);
mRejectCallOverlay.setAlpha(0.0f);
mSendSmsOverlay.setAlpha(0.0f);

// hide buttons
mFloatingRejectCallTimerButton.hide();
mFloatingAnswerCallTimerButton.hide();
mFloatingCancelOverlayButton.hide();
mFloatingSendSMSButton.hide();
mFloatingCancelSMS.hide();
mFloatingCancelTimerButton.hide();
mSendSmsButton.setVisibility(View.GONE);
// Hide
hideOverlays();
hideButtons();

// Set the correct text for the TextView
String rejectCallSeconds = PreferenceUtils.getInstance().getString(R.string.pref_reject_call_timer_key);
Expand Down Expand Up @@ -311,6 +300,8 @@ public void onSwipeBottom() {
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN); // Hide the bottom sheet
}

// -- Overrides -- //

@Override
protected void onPostCreate(@Nullable Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
Expand All @@ -320,6 +311,14 @@ protected void onPostCreate(@Nullable Bundle savedInstanceState) {
updateUI(CallManager.getState());
}

/**
* To disable back button
*/
@Override
public void onBackPressed() {

}

@Override
protected void onStart() {
super.onStart();
Expand Down Expand Up @@ -619,6 +618,31 @@ private void setActionButtonsClickable(boolean clickable) {
}
}

/**
* Hide all buttons
*/
private void hideButtons(){
// hide buttons
mFloatingRejectCallTimerButton.hide();
mFloatingAnswerCallTimerButton.hide();
mFloatingCancelOverlayButton.hide();
mFloatingSendSMSButton.hide();
mFloatingCancelSMS.hide();
mFloatingCancelTimerButton.hide();
mSendSmsButton.setVisibility(View.GONE);
}

/**
* Hide all overlays
*/
private void hideOverlays(){
//Hide all overlays
mActionTimerOverlay.setAlpha(0.0f);
mAnswerCallOverlay.setAlpha(0.0f);
mRejectCallOverlay.setAlpha(0.0f);
mSendSmsOverlay.setAlpha(0.0f);
}

// -- Overlays -- //

private void setLayerEnabled(@NotNull ViewGroup layer, boolean isEnabled) {
Expand Down
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M7.41,7.84L12,12.42l4.59,-4.58L18,9.25l-6,6 -6,-6z"/>
</vector>
15 changes: 13 additions & 2 deletions app/src/main/res/layout/fragment_dial.xml
Expand Up @@ -13,8 +13,19 @@
android:outlineSpotShadowColor="@color/green_phone"
tools:context=".ui.fragment.DialerFragment">

<!-- Number Input Field -->
<ImageView
android:id="@+id/swipe_down_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:backgroundTint="@color/grey_400"
android:padding="0dp"
android:src="@drawable/ic_keyboard_arrow_down_black_24dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<!-- Number Input Field -->
<RelativeLayout
android:id="@+id/top_dialer"
android:layout_width="0dp"
Expand All @@ -24,7 +35,7 @@
android:elevation="@dimen/dialer_elevation"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
app:layout_constraintTop_toBottomOf="@id/swipe_down_view">

<ImageView
android:id="@+id/button_call"
Expand Down

0 comments on commit 1ea87eb

Please sign in to comment.