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

Commit abe61cb7 authored by Wysie's avatar Wysie Committed by ABAAKOUK Mehdi
Browse files

Release 0.9.

- Preference to show/hide separators in Contacts
- Preference to show/hide contact pictures in Contacts/Favourites
parent 029e1b64
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1189,6 +1189,11 @@
    <string name="title_contacts_show_pic">Show contact pictures</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_show_count">Show contacts count</string>
    <string name="summary_contacts_show_count">Contacts count will be shown at the top of the contacts list</string>
    <string name="title_contacts_show_separators">Show alphabetical separators</string>
    <string name="summaryon_contacts_show_separators">Alphabetical separators will be shown in the contacts list</string>
    <string name="summaryoff_contacts_show_separators">Alphabetical separators will be hidden in the contacts list</string>
    
    <!-- Preferences: Contacts - View Contact -->
    <string name="title_view_contact">View contact</string>
@@ -1214,7 +1219,7 @@
    <string name="title_about_name">Mod Name</string>
    <string name="summary_about_name">WyContacts Eclair</string>
    <string name="title_about_version">Version</string>
    <string name="summary_about_version">0.8</string>
    <string name="summary_about_version">0.9</string>
    <string name="title_about_credits">Credits</string>
    <string name="summary_about_credits">ChainsDD, geesun, niuchl, rac2030 and the rest of XDA! :)</string>
    
+25 −5
Original line number Diff line number Diff line
@@ -92,6 +92,17 @@
        </PreferenceScreen>
    </PreferenceCategory>
    <PreferenceCategory android:title="@string/recentCallsIconLabel">
        <!--
        <CheckBoxPreference
            android:key="cl_show_dial_button"
            android:title="@string/title_contacts_show_dial_button"
            android:summary="@string/summary_contacts_show_dial_button"
            android:defaultValue="true" />
        <CheckBoxPreference
            android:key="cl_show_pic"
            android:title="@string/title_contacts_show_pic"
            android:defaultValue="true" />
        -->
        <CheckBoxPreference
            android:key="cl_exact_time"
            android:title="@string/title_cl_exact_time"
@@ -118,12 +129,23 @@
            android:title="@string/title_contacts_show_dial_button"
            android:summary="@string/summary_contacts_show_dial_button"
            android:defaultValue="true" />
        <!--
        <CheckBoxPreference
            android:key="contacts_show_pic"
            android:title="@string/title_contacts_show_pic"
            android:defaultValue="true" />
        <!--
        <CheckBoxPreference
            android:key="contacts_show_count"
            android:title="@string/title_contacts_show_count"
            android:summary="@string/summary_contacts_show_count"
            android:defaultValue="true" />
        -->
        <CheckBoxPreference
            android:key="contacts_show_alphabetical_separators"
            android:title="@string/title_contacts_show_separators"
            android:summaryOn="@string/summaryon_contacts_show_separators"
            android:summaryOff="@string/summaryoff_contacts_show_separators"
            android:defaultValue="true" />
        <PreferenceScreen
            android:key="view_contact"
            android:title="@string/title_view_contact"
@@ -141,12 +163,10 @@
            android:key="favs_show_dial_button"
            android:title="@string/title_contacts_show_dial_button"
            android:defaultValue="true" />
        <!--
        <CheckBoxPreference
            android:key="favs_show_pic"
            android:title="@string/title_contacts_show_pic"
            android:defaultValue="true" />
        -->
        <CheckBoxPreference
            android:key="favourites_hide_freq_called"
            android:title="@string/title_favourites_hide_freq_call"
+76 −3
Original line number Diff line number Diff line
@@ -499,6 +499,7 @@ public class ContactsListActivity extends ListActivity implements View.OnCreateC
    private static boolean showContactsPic;
    private static boolean showFavsDialButton;
    private static boolean showFavsPic;
    private static boolean showDisplayHeaders;
    private MenuItem mClearFreqCalled;

    static {
@@ -1064,6 +1065,7 @@ public class ContactsListActivity extends ListActivity implements View.OnCreateC
        showContactsPic = ePrefs.getBoolean("contacts_show_pic", true);
        showFavsDialButton = ePrefs.getBoolean("favs_show_dial_button", true);
        showFavsPic = ePrefs.getBoolean("favs_show_pic", true);
        showDisplayHeaders = ePrefs.getBoolean("contacts_show_alphabetical_separators", true);

        registerProviderStatusObserver();
        mPhotoLoader.resume();
@@ -2906,6 +2908,68 @@ public class ContactsListActivity extends ListActivity implements View.OnCreateC

            if ((mMode & MODE_MASK_SHOW_PHOTOS) == MODE_MASK_SHOW_PHOTOS) {
                mDisplayPhotos = true;
                setViewResource(R.layout.contacts_list_item_photo);
                mBitmapCache = new HashMap<Long, SoftReference<Bitmap>>();
                mItemsMissingImages = new HashSet<ImageView>();
            }

            if (mMode == MODE_STREQUENT || mMode == MODE_FREQUENT) {
                mDisplaySectionHeaders = false;
            }           

        }

        private class ImageFetchHandler extends Handler {

            @Override
            public void handleMessage(Message message) {
                if (ContactsListActivity.this.isFinishing()) {
                    return;
                }
                switch(message.what) {
                    case FETCH_IMAGE_MSG: {
                        final ImageView imageView = (ImageView) message.obj;
                        if (imageView == null) {
                            break;
                        }

                        final PhotoInfo info = (PhotoInfo)imageView.getTag();
                        if (info == null) {
                            break;
                        }

                        final long photoId = info.photoId;
                        if (photoId == 0) {
                            break;
                        }

                        SoftReference<Bitmap> photoRef = mBitmapCache.get(photoId);
                        if (photoRef == null) {
                            break;
                        }
                        Bitmap photo = photoRef.get();
                        if (photo == null) {
                            mBitmapCache.remove(photoId);
                            break;
                        }

                        // Make sure the photoId on this image view has not changed
                        // while we were loading the image.
                        synchronized (imageView) {
                            final PhotoInfo updatedInfo = (PhotoInfo)imageView.getTag();
                            long currentPhotoId = updatedInfo.photoId;
                            if (currentPhotoId == photoId) {
                                imageView.setImageBitmap(photo);
                                mItemsMissingImages.remove(imageView);
                            }
                        }
                        break;
                    }
                }
            }

            public void clearImageFecthing() {
                removeMessages(FETCH_IMAGE_MSG);
            }
        }

@@ -3048,6 +3112,12 @@ public class ContactsListActivity extends ListActivity implements View.OnCreateC
                v = convertView;
            }
            bindView(v, mContext, cursor);
            
            //Wysie
            if (mContacts) {
                mDisplaySectionHeaders = showDisplayHeaders;                
            }
            
            bindSectionHeader(v, realPosition, mDisplaySectionHeaders && !showingSuggestion);
            return v;
        }
@@ -3192,15 +3262,12 @@ public class ContactsListActivity extends ListActivity implements View.OnCreateC
                else {
                    mDisplayCallButton = false;
                }

                /*
                if ((mContacts && showContactsPic) || (mFavs && showFavsPic)) {
                    mDisplayPhotos = true;
                }
                else {
                    mDisplayPhotos = false;
                }
                */
            }

            // Make the call button visible if requested.
@@ -3235,6 +3302,12 @@ public class ContactsListActivity extends ListActivity implements View.OnCreateC
                final int position = cursor.getPosition();
                mPhotoLoader.loadPhoto(viewToUse, photoId);
            }
            else {
                if (cache.photoView != null)
                    cache.photoView.setVisibility(View.GONE);
                if (cache.nonQuickContactPhotoView != null)
                    cache.nonQuickContactPhotoView.setVisibility(View.GONE);
            }

            if ((mMode & MODE_MASK_NO_PRESENCE) == 0) {
                // Set the proper icon (star or presence or nothing)