Coder Social home page Coder Social logo

Auto Vibrate Mode about koler HOT 5 CLOSED

chooloo avatar chooloo commented on May 24, 2024
Auto Vibrate Mode

from koler.

Comments (5)

roeiedri avatar roeiedri commented on May 24, 2024

Thank you very much for the feedback
As we wish we would have the time to solve this unfortunately we currently don't
We hope you are still enjoying the app considering the problems

from koler.

roeiedri avatar roeiedri commented on May 24, 2024

Were back!
About the issue... could you describe more?
The issue happens with no relation to anything?
Did you change the audio settings before the call?

from koler.

adityadhiman avatar adityadhiman commented on May 24, 2024

Solution :
In Activity OngoingCallActivity replace code of ActionTimer

class ActionTimer {

    CountDownTimer mTimer = null;
    boolean mIsRejecting = true;
    boolean mIsActionTimerEnable = false;

    Integer oldVolume;

    private void setData(long millisInFuture, boolean isRejecting) {
        mIsRejecting = isRejecting;
        @ColorRes int textColorRes;
        @StringRes int textIndicator;
        if (isRejecting) {
            textColorRes = R.color.red_phone;
            textIndicator = R.string.reject_timer_indicator;
        } else {
            textColorRes = R.color.green_phone;
            textIndicator = R.string.answer_timer_indicator;
        }

        @ColorInt int textColor = ContextCompat.getColor(OngoingCallActivity.this, textColorRes);
        mActionTimeLeftText.setTextColor(textColor);
        mTimerIndicatorText.setText(textIndicator);

        mTimer = new CountDownTimer(millisInFuture, REFRESH_RATE) {
            Locale mLocale = Locale.getDefault();

            @Override
            public void onTick(long millisUntilFinished) {
                int secondsUntilFinished = (int) (millisUntilFinished / 1000);
                String timer = String.format(mLocale, "00:%02d", secondsUntilFinished);
                mActionTimeLeftText.setText(timer);
            }

            @Override
            public void onFinish() {
                end();
            }
        };
    }

    private void start() {
        mIsActionTimerEnable = true;
        oldVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_RING);
        mAudioManager.setStreamVolume(AudioManager.STREAM_RING, 0, 0);
        if (mTimer != null) mTimer.start();
        else Timber.w("Couldn't start action timer (timer is null)");

        if (mActionTimerOverlay != null) setOverlay(mActionTimerOverlay);
    }

    private void cancel() {
        if (mTimer != null) mTimer.cancel();
        else Timber.w("Couldn't cancel action timer (timer is null)");

        finalEndCommonMan();
    }

    private void end() {
        if (mIsRejecting) endCall();
        else activateCall();

        finalEndCommonMan();
    }

    private void finalEndCommonMan() {
        if (mIsActionTimerEnable){
            mAudioManager.setStreamVolume(AudioManager.STREAM_RING, oldVolume, 0);
        }
        mIsActionTimerEnable = false;
        removeOverlay();
    }
}

from koler.

roeiedri avatar roeiedri commented on May 24, 2024

from koler.

roeiedri avatar roeiedri commented on May 24, 2024

Sorry for the insane delay, can u explain how does that code is responsible for fixing the issue
Does the issue happens only when using call timer?

from koler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.