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

Commit 7e4c453a authored by Steve Kondik's avatar Steve Kondik
Browse files

Merge branch 'donut' of git://github.com/Wysie/android_packages_apps_Contacts into donut

parents 8cba2905 7b0d7f04
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -29,13 +29,16 @@
        android:gravity="center_vertical"
    >
    
        
        <!--Wysie_Soh: Default width and height is 78 -->
        <!-- android:scaleType="fitCenter" -->
        <ImageView android:id="@+id/photo"
            style="?android:attr/imageWellStyle"
            android:layout_width="78dip"
            android:layout_height="78dip"
            android:layout_marginRight="7dip"
            android:layout_marginLeft="2dip"
            android:scaleType="fitCenter"
            android:scaleType="fitXY"
            android:background="@drawable/btn_contact_picture"
        />

+13 −0
Original line number Diff line number Diff line
@@ -73,4 +73,17 @@
        <item>PF Voicemail/com.phonefusion.voicemailplus.android/.VoicemailPlus</item>
    </string-array>
    
    <string-array name="view_contact_pic_sizes">
        <item>Small (Default)</item>
        <item>Medium</item>
        <item>Large</item>
        <item>Extra Large</item>
    </string-array>
    
    <string-array name="view_contact_pic_sizes_values">
        <item>78</item>
        <item>100</item>
        <item>116</item>
        <item>128</item>
    </string-array>
</resources>
+15 −2
Original line number Diff line number Diff line
@@ -776,6 +776,8 @@
    <string name="title_use_custom_color">Use custom digits colors</string>
    <string name="summaryon_custom_color">Supported formats: #RRGGBB or #AARRGGBB. Input the # as well.</string>
    
    <string name="title_change_digits_color">Change digits color</string>
    
    <string name="title_call_log_category">Call log</string>    
    <string name="title_cl_relative_time">Relative times</string>
    <string name="summaryon_cl_relative_time">Use relative times in call log</string>
@@ -788,9 +790,12 @@
    
    <string name="title_contacts_category">Contacts</string>
    <string name="title_contacts_show_pic">Show contact pictures</string>
    <string name="summary_contacts_show_pic">Please restart Contacts/Dialer to see the changes</string>
    <string name="summary_contacts_show_pic">Affects Favs as well. Restart Contacts/Dialer to see changes</string>
    <string name="title_contacts_show_dial_button">Show dial button</string>
    <string name="summary_contacts_show_dial_button">Show a dial button for contacts with numbers</string>
    <string name="title_contacts_view_pic_size">View contact picture size</string>
    <string name="summary_contacts_view_pic_size">Affects Favs as well. Sets size of picture when viewing contact</string>
    <string name="title_contacts_choose_pic_size">Choose a size</string>
    
    <string name="title_favourites_category">Favourites</string>
    <string name="title_favourites_hide_freq_call">Hide frequently called</string>
@@ -802,6 +807,14 @@
    <string name="title_misc_category">Miscellaneous</string>
    <string name="title_sensor_rotation">Enable sensor rotation</string>
    
    <string name="title_about">About</string>
    <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">1.94</string>
    <string name="title_about_credits">Credits</string>
    <string name="summary_about_credits">ChainsDD and the rest of XDA! :)</string>
    
    <!-- Wysie_Soh: Call log strings -->  
    <string name="alert_clear_call_log_title">Clear call log</string>
    <string name="alert_clear_call_log_message">Are you sure you want to clear all call records?</string>
+71 −40
Original line number Diff line number Diff line
@@ -38,16 +38,19 @@
            android:summaryOn="@string/summaryon_disable_num_check"
            android:summaryOff="@string/summaryoff_disable_num_check"
            android:defaultValue="false" />
        <PreferenceScreen
            android:key="dial_digits_color"
            android:title="@string/title_change_digits_color">  
                <ListPreference
            android:key="focused_digit_color"
            android:title="@string/title_digits_color_focused"
                    android:key="pressed_digit_color"
                    android:title="@string/title_digits_color_pressed"
                    android:dialogTitle="@string/title_choose_color"
                    android:entries="@array/digits_colors"
                    android:entryValues="@array/digits_colors_values"
                    android:defaultValue="-16777216" />
                <ListPreference
            android:key="pressed_digit_color"
            android:title="@string/title_digits_color_pressed"
                    android:key="focused_digit_color"
                    android:title="@string/title_digits_color_focused"
                    android:dialogTitle="@string/title_choose_color"
                    android:entries="@array/digits_colors"
                    android:entryValues="@array/digits_colors_values"
@@ -65,18 +68,19 @@
                    android:defaultValue="false"
                    android:summary="@string/summaryon_custom_color"
                    android:disableDependentsState="false" />
        <EditTextPreference
            android:key="focused_digit_color_custom"
            android:title="@string/title_digits_color_focused"
            android:dependency="dial_digit_use_custom_color" />
                <EditTextPreference
                    android:key="pressed_digit_color_custom"
                    android:title="@string/title_digits_color_pressed"
                    android:dependency="dial_digit_use_custom_color" />
                <EditTextPreference
                    android:key="focused_digit_color_custom"
                    android:title="@string/title_digits_color_focused"
                    android:dependency="dial_digit_use_custom_color" />
                <EditTextPreference
                    android:key="unselected_digit_color_custom"
                    android:title="@string/title_digits_color_unselected"
                    android:dependency="dial_digit_use_custom_color" />
        </PreferenceScreen>
    </PreferenceCategory>
    <PreferenceCategory android:title="@string/recentCallsIconLabel">
        <CheckBoxPreference
@@ -110,6 +114,14 @@
            android:title="@string/title_contacts_show_pic"
            android:summary="@string/summary_contacts_show_pic"
            android:defaultValue="true" />
        <ListPreference
            android:key="contacts_view_contact_pic_size"
            android:title="@string/title_contacts_view_pic_size"
            android:summary="@string/summary_contacts_view_pic_size"
            android:dialogTitle="@string/title_contacts_choose_pic_size"
            android:entries="@array/view_contact_pic_sizes"
            android:entryValues="@array/view_contact_pic_sizes_values"
            android:defaultValue="78" />
    </PreferenceCategory>
    <PreferenceCategory android:title="@string/contactsFavoritesLabel">
        <CheckBoxPreference
@@ -131,6 +143,25 @@
            android:key="misc_sensor_rotation"
            android:title="@string/title_sensor_rotation"
            android:defaultValue="false" />
        <PreferenceScreen
            android:key="misc_about"
            android:title="@string/title_about"> 
          <Preference
                android:key="about_name"
                android:title="@string/title_about_name"
                android:summary="@string/summary_about_name"
                android:enabled="false" />
            <Preference
                android:key="about_version"
                android:title="@string/title_about_version"
                android:summary="@string/summary_about_version"
                android:enabled="false" />
            <Preference
                android:key="about_credits"
                android:title="@string/title_about_credits"
                android:summary="@string/summary_about_credits"
                android:enabled="false" />
        </PreferenceScreen>
    </PreferenceCategory>    
    
</PreferenceScreen>
+53 −76
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ import android.content.ContentValues;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.SharedPreferences;
import android.content.res.ColorStateList;
import android.content.res.Resources;
@@ -466,6 +467,11 @@ public final class EditContactActivity extends Activity implements View.OnClickL
        } else {
            setTitle(getResources().getText(R.string.editContact_title_insert));
        }
        
        loadCurrentMembership();
        
        //Wysie_Soh: Testing purposes (Emulate keyboard slide-out/orientation change)
        //this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
    }

    private void setupSections() {
@@ -1941,6 +1947,7 @@ public final class EditContactActivity extends Activity implements View.OnClickL
            focusChild.requestFocus();
            if (focusChild instanceof EditText) {
                // Index ends beyond data length.
                try {
                    if (entry.requestCursor > entry.data.length()) {
                        entry.requestCursor = entry.data.length();
                    }
@@ -1950,6 +1957,10 @@ public final class EditContactActivity extends Activity implements View.OnClickL
                    }
                    ((EditText) focusChild).setSelection(entry.requestCursor);
                }
                catch (NullPointerException e) { //Wysie_Soh: If nothing is entered into the field yet, entry.data.length() will be null.
                    entry.requestCursor = ((EditText) focusChild).getSelectionStart();
                }
            }
        }

        // Reset requested focus values
@@ -2527,11 +2538,19 @@ public final class EditContactActivity extends Activity implements View.OnClickL
        CharSequence[] groupsCharSeq = null;           
        boolean[] checkedValues = null;
        
        // If selected groups already has something inside, we use it
        if (selectedGroups.size() > 0) {
            Cursor cursor = mResolver.query(Groups.CONTENT_URI, GROUPS_PROJECTION, null, null, Groups.DEFAULT_SORT_ORDER);
            
            groupsCharSeq = groups.toArray(
                    new CharSequence[groups.size()]);
            try {
                if (cursor.moveToFirst()) {
                    while (cursor.moveToNext()) {            
                        String name = cursor.getString(
                                cursor.getColumnIndex(Groups.NAME));

                        groups.add(name);                
                    }
                }

                groupsCharSeq = groups.toArray(new CharSequence[groups.size()]);                

                checkedValues = new boolean[groups.size()];

@@ -2539,6 +2558,8 @@ public final class EditContactActivity extends Activity implements View.OnClickL
                    b = false;
                }
                
                if (!(mState == STATE_INSERT)) {

                    for (int i = 0; i < selectedGroups.size(); i++) {
                      int j = groups.indexOf(selectedGroups.get(i));

@@ -2546,85 +2567,41 @@ public final class EditContactActivity extends Activity implements View.OnClickL
                            checkedValues[j] = true;
                        }
                    }
                }
            } finally {
                cursor.close();
            }

            builder.setMultiChoiceItems(groupsCharSeq, checkedValues,
                    confirmGroupSelectionListener);  
        } else {
            Cursor cursor = mResolver.query(Groups.CONTENT_URI, GROUPS_PROJECTION, null,
                    null, Groups.DEFAULT_SORT_ORDER);
            try {
                groups = new ArrayList<CharSequence>();

                if (cursor.moveToFirst()) {
                    while (cursor.moveToNext()) {            
                        String name = cursor.getString(
                                cursor.getColumnIndex(Groups.NAME));

                        groups.add(name);                
                    }
    }
    
                groupsCharSeq = groups.toArray(new CharSequence[groups.size()]);
                
    //Wysie_Soh: Load person's current membership into currentMembership ArrayList    
    private void loadCurrentMembership() {
        if (!(mState == STATE_INSERT)) {
            long personId = ContentUris.parseId(mUri);
            
                Cursor groupCursor = mResolver.query(GroupMembership.CONTENT_URI,
                        GROUP_MEMBERSHIP_PROJECTION,
                        GroupMembership.PERSON_ID + "='" + personId + "'", null,
                        null);
            Cursor groupCursor = mResolver.query(GroupMembership.CONTENT_URI, GROUP_MEMBERSHIP_PROJECTION,
                                GroupMembership.PERSON_ID + "='" + personId + "'", null, null);
            Cursor cur = null;
            
            if (groupCursor != null) {
                while (groupCursor.moveToNext()) {
                        cur = mResolver.query(Groups.CONTENT_URI,
                                GROUPS_PROJECTION,
                                Contacts.Groups._ID + "='"
                                + groupCursor.getString(
                                groupCursor.getColumnIndex(
                                        GroupMembership.GROUP_ID))
                                        + "'",
                                        null,
                                        null);
                    cur = mResolver.query(Groups.CONTENT_URI, GROUPS_PROJECTION, Contacts.Groups._ID + "='" 
                            + groupCursor.getString(groupCursor.getColumnIndex(GroupMembership.GROUP_ID))
                            + "'", null, null);
                    
                    if (cur != null) {
                        if (cur.moveToFirst()) {
                                currentMembership.add(
                                        cur.getString(
                                                cur.getColumnIndex(Groups.NAME)));
                            currentMembership.add(cur.getString(cur.getColumnIndex(Groups.NAME)));
                        }
                            cur.close();
                        }
                }
                groupCursor.close();
                    
            }
        }        

                checkedValues = new boolean[groups.size()];

                for (boolean b : checkedValues) {
                    b = false;
                }
                
                if (!(mState == STATE_INSERT)) {

                for (int i = 0; i < currentMembership.size(); i++) {
                    int j = groups.indexOf(currentMembership.get(i));

                    if (j != -1) {
                        checkedValues[j] = true;
                        selectedGroups.add(groups.get(j));
                    }
                }
                }
            } finally {
                cursor.close();
            }

            builder.setMultiChoiceItems(groupsCharSeq, checkedValues,
                    confirmGroupSelectionListener);           

        }
        selectedGroups = (ArrayList) currentMembership.clone();      
    }

    private DialogInterface.OnClickListener confirmGroupChangesListener = new DialogInterface.OnClickListener() {
Loading