Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3eecd88 authored by Stefano Picciolo's avatar Stefano Picciolo Committed by Steve Kondik
Browse files

Show custom app name on LockScreen

Show custom app name on LockScreen (Sliding Tab style) instead of generic "Messaging" label

Change-Id: If555d36dcbe7fdb8767e94da1d0ab5a82060def2
parent 76a4c6df
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -230,6 +230,10 @@ public class SlidingTab extends ViewGroup {
            text.setText(resId);
        }

        void setHintText(CharSequence charText) {
            text.setText(charText);
        }

        void hide() {
            boolean horiz = alignment == ALIGN_LEFT || alignment == ALIGN_RIGHT;
            int dx = horiz ? (alignment == ALIGN_LEFT ? alignment_value - tab.getRight()
@@ -796,6 +800,12 @@ public class SlidingTab extends ViewGroup {
        }
    }

    public void setRightHintText(CharSequence charText) {
       if (isHorizontal()) {
           mRightSlider.setHintText(charText);
       }
    }

    public void setHoldAfterTrigger(boolean holdLeft, boolean holdRight) {
        mHoldLeftOnTransition = holdLeft;
        mHoldRightOnTransition = holdRight;
+15 −2
Original line number Diff line number Diff line
@@ -54,6 +54,8 @@ import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.Vibrator;
import android.provider.Settings;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;

import java.util.ArrayList;
import java.util.Date;
@@ -334,8 +336,19 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
        if (mSelector2 != null) {
            mSelector2.setHoldAfterTrigger(true, false);
            mSelector2.setLeftHintText(R.string.lockscreen_phone_label);
            mSelector2.setRightHintText(R.string.lockscreen_messaging_label);

            if (mCustomAppActivity != null) {
                Intent i;
                try {
                    i = Intent.parseUri(mCustomAppActivity, 0);
                    PackageManager pm = context.getPackageManager();
                    ActivityInfo ai = i.resolveActivityInfo(pm,PackageManager.GET_ACTIVITIES);
                    mSelector2.setRightHintText(ai.loadLabel(pm).toString());
                } catch (URISyntaxException e) {
                }
            }
        }

        mEmergencyCallText = (TextView) findViewById(R.id.emergencyCallText);
        mEmergencyCallButton = (Button) findViewById(R.id.emergencyCallButton);
        mEmergencyCallButton.setText(R.string.lockscreen_emergency_call);