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

Commit 14cedf41 authored by Wysie's avatar Wysie
Browse files

Release 2.1. Added haptic feedback for dialer. Cleaned up some code.

Also fixed some minor GUI issues from the backport (I believe AOSP's code is wrong, see comments under bindSectionHeader in ContactsListActivity.java)
parent 0dc5accb
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -769,6 +769,7 @@
    <string name="title_use_1_for_reg_vm">Use 1 for regular voicemail</string>
    <string name="summaryon_use_1_for_reg_vm">Key 1 will be used for regular voicemail</string>
    <string name="summaryoff_use_1_for_reg_vm">Key 1 will follow voicemail handler</string>
    <string name="title_enable_haptic_feedback">Enable haptic feedback</string>
    
    <string name="title_digits_color_unselected">Digits color (not selected)</string>
    <string name="title_digits_color_focused">Digits color (focused)</string>
@@ -814,7 +815,7 @@
    <string name="title_about_name">Mod Name</string>
    <string name="summary_about_name">Wysie Contacts</string>
    <string name="title_about_version">Version</string>
    <string name="summary_about_version">2.01</string>
    <string name="summary_about_version">2.1</string>
    <string name="title_about_credits">Credits</string>
    <string name="summary_about_credits">ChainsDD and the rest of XDA! :)</string>
    
+4 −0
Original line number Diff line number Diff line
@@ -43,6 +43,10 @@
            android:summaryOn="@string/summaryon_disable_num_check"
            android:summaryOff="@string/summaryoff_disable_num_check"
            android:defaultValue="false" />
        <CheckBoxPreference
            android:key="dial_enable_haptic"
            android:title="@string/title_enable_haptic_feedback"
            android:defaultValue="false" />
        <PreferenceScreen
            android:key="dial_digits_color"
            android:title="@string/title_change_digits_color">  
+10 −4
Original line number Diff line number Diff line
@@ -332,7 +332,7 @@ public final class ContactsListActivity extends ListActivity
    private String mShortcutAction;
    private boolean mDefaultMode = false;
    private boolean mFavTab = false;
    private boolean mDisplaySectionHeaders = true;
    private boolean mDisplaySectionHeaders = false; //With it set to false, separators will only show in "Contacts" tab, and based on prefs.
    private boolean mContactsTab = false;
    
    //MenuItem for Clear Freq. Called
@@ -1980,7 +1980,10 @@ public final class ContactsListActivity extends ListActivity
            final ContactListItemCache cache = (ContactListItemCache) view.getTag();
            if (!displaySectionHeaders) {
                cache.header.setVisibility(View.GONE);
                cache.divider.setVisibility(View.VISIBLE);
                
                //Wysie_Soh: AOSP master sets it to View.VISIBLE. I think it's a mistake cause it simply makes the separator between
                //each contact thicker.
                cache.divider.setVisibility(View.GONE);
            } else {
                final int section = getSectionForPosition(position);
                if (getPositionForSection(section) == position) {
@@ -1996,10 +1999,13 @@ public final class ContactsListActivity extends ListActivity
                }

                // move the divider for the last item in a section
                // 
                if (getPositionForSection(section + 1) - 1 == position) {
                    cache.divider.setVisibility(View.GONE);
                } else {
                    // Wysie_Soh: AOSP master sets it to View.GONE, seems like a mistake
                    cache.divider.setVisibility(View.VISIBLE);
                } else {
                    // Wysie_Soh: AOSP master sets it to View.VISIBLE, seems like a mistake
                    cache.divider.setVisibility(View.GONE);
                }
            }
        }
+14 −1
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ import android.view.MenuItem.OnMenuItemClickListener;
import com.android.internal.telephony.ITelephony;
import android.content.res.Configuration;


/**
 * Dialer activity that displays the typical twelve key interface.
 */
@@ -101,6 +102,7 @@ public class TwelveKeyDialer extends Activity implements View.OnClickListener,
    private View mVoicemailDialAndDeleteRow;
    private ImageButton mVoicemailButton, mDialButton, mDelete;
    private SharedPreferences prefs;    
    private Vibrator vibrator; 

    private ListView mDialpadChooser;
    private DialpadChooserAdapter mDialpadChooserAdapter;
@@ -222,6 +224,9 @@ public class TwelveKeyDialer extends Activity implements View.OnClickListener,
        initVoicemailButton();
        checkForNumber();
        
        //Wysie_Soh: Initialize vibrator
        vibrator = (Vibrator)getSystemService(Context.VIBRATOR_SERVICE);

        // If the mToneGenerator creation fails, just continue without it.  It is
        // a local audio signal, and is not as important as the dtmf tone itself.
        synchronized (mToneGeneratorLock) {
@@ -614,6 +619,10 @@ public class TwelveKeyDialer extends Activity implements View.OnClickListener,
    }

    public void onClick(View view) {
        if (prefs.getBoolean("dial_enable_haptic", false)) {
            vibrator.vibrate(50);
        }
        
        switch (view.getId()) {
            case R.id.one: {
                playTone(ToneGenerator.TONE_DTMF_1);
@@ -709,6 +718,10 @@ public class TwelveKeyDialer extends Activity implements View.OnClickListener,
    }

    public boolean onLongClick(View view) {
        if (prefs.getBoolean("dial_enable_haptic", false)) {
            vibrator.vibrate(50);
        }
        
        Editable digits = mDigits.getText();
        int id = view.getId();
        switch (id) {