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

Commit a87365c4 authored by Wysie's avatar Wysie
Browse files

Release 2.33.

Added some prefs to hide labels/numbers for Call Log, Contacts and Favourites.
Also, when viewing a contact, you can now copy the name by long-pressing on it.
parent aee3b4a7
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -824,6 +824,14 @@
    <string name="summaryon_favs_ask_before_clear">Ask before clearing frequently called</string>
    <string name="summaryoff_favs_ask_before_clear">Frequently called entries will be cleared without asking</string>
    
    <string name="title_all_show_label">Show label</string>
    <string name="summaryon_all_show_label">Label (Mobile, Home, etc.) will be shown</string>
    <string name="summaryoff_all_show_label">Label (Mobile, Home, etc.) will be hidden</string>
    
    <string name="title_all_show_number">Show number</string>
    <string name="summaryon_all_show_number">Phone number will be shown</string>
    <string name="summaryoff_all_show_number">Phone number will be hidden</string>
    
    <string name="title_misc_category">Miscellaneous</string>
    <string name="title_sensor_rotation">Enable sensor rotation</string>
    
@@ -831,7 +839,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.32</string>
    <string name="summary_about_version">2.33</string>
    <string name="title_about_credits">Credits</string>
    <string name="summary_about_credits">ChainsDD and the rest of XDA! :)</string>
    
+37 −1
Original line number Diff line number Diff line
@@ -113,6 +113,18 @@
            android:summary="@string/summary_cl_show_seconds"
            android:dependency="cl_relative_time"
            android:defaultValue="true" />
        <CheckBoxPreference
            android:key="cl_show_label"
            android:title="@string/title_all_show_label"
            android:summaryOn="@string/summaryon_all_show_label"
            android:summaryOff="@string/summaryoff_all_show_label"
            android:defaultValue="true" />
        <CheckBoxPreference
            android:key="cl_show_number"
            android:title="@string/title_all_show_number"
            android:summaryOn="@string/summaryon_all_show_number"
            android:summaryOff="@string/summaryoff_all_show_number"
            android:defaultValue="true" />
        <CheckBoxPreference
            android:key="cl_ask_before_clear"
            android:title="@string/title_cl_ask_before_clear"
@@ -130,6 +142,18 @@
            android:key="contacts_show_pic"
            android:title="@string/title_contacts_show_pic"
            android:defaultValue="true" />
        <CheckBoxPreference
            android:key="contacts_show_label"
            android:title="@string/title_all_show_label"
            android:summaryOn="@string/summaryon_all_show_label"
            android:summaryOff="@string/summaryoff_all_show_label"
            android:defaultValue="true" />
        <CheckBoxPreference
            android:key="contacts_show_number"
            android:title="@string/title_all_show_number"
            android:summaryOn="@string/summaryon_all_show_number"
            android:summaryOff="@string/summaryoff_all_show_number"
            android:defaultValue="true" />
        <CheckBoxPreference
            android:key="contacts_show_alphabetical_separators"
            android:title="@string/title_contacts_show_separators"
@@ -176,6 +200,18 @@
            android:key="favs_show_pic"
            android:title="@string/title_contacts_show_pic"
            android:defaultValue="true" />
        <CheckBoxPreference
            android:key="favs_show_label"
            android:title="@string/title_all_show_label"
            android:summaryOn="@string/summaryon_all_show_label"
            android:summaryOff="@string/summaryoff_all_show_label"
            android:defaultValue="true" />
        <CheckBoxPreference
            android:key="favs_show_number"
            android:title="@string/title_all_show_number"
            android:summaryOn="@string/summaryon_all_show_number"
            android:summaryOff="@string/summaryoff_all_show_number"
            android:defaultValue="true" />
        <CheckBoxPreference
            android:key="favourites_hide_freq_called"
            android:title="@string/title_favourites_hide_freq_call"
+36 −4
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ import android.widget.AlphabetIndexer;
import android.widget.Filter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.ResourceCursorAdapter;
import android.widget.SectionIndexer;
import android.widget.TextView;
@@ -2086,13 +2087,24 @@ public final class ContactsListActivity extends ListActivity
            divView = cache.dividerView;
            callView = cache.callView;
            
            RelativeLayout.LayoutParams newNameLayout = (RelativeLayout.LayoutParams) cache.nameView.getLayoutParams();
            RelativeLayout.LayoutParams newNumberLayout = (RelativeLayout.LayoutParams) numberView.getLayoutParams();
            
            cursor.copyStringToBuffer(NUMBER_COLUMN_INDEX, cache.numberBuffer);
            size = cache.numberBuffer.sizeCopied;
            
            if (size != 0) {
                
                if ((ePrefs.getBoolean("contacts_show_number", true) && mContactsTab) || (ePrefs.getBoolean("favs_show_number", true) && mFavTab)) {
                    numberView.setText(cache.numberBuffer.data, 0, size);                              
                    numberView.setVisibility(View.VISIBLE);
                }
                else {
                    numberView.setVisibility(View.GONE);
                }
                
                labelView.setVisibility(View.VISIBLE);
                
                if ((ePrefs.getBoolean("contacts_show_dial_button", true) && mContactsTab) ||
                    (ePrefs.getBoolean("favs_show_dial_button", true) && mFavTab)) {
                	callView.setTag(new String(cache.numberBuffer.data, 0, size)); //Wysie_Soh: Set tag to green dial button
@@ -2112,7 +2124,8 @@ public final class ContactsListActivity extends ListActivity
            }

            // Set the label
            if (!cursor.isNull(TYPE_COLUMN_INDEX)) {
            if (!cursor.isNull(TYPE_COLUMN_INDEX) && ((ePrefs.getBoolean("contacts_show_label", true) && mContactsTab) ||
                    (ePrefs.getBoolean("favs_show_label", true) && mFavTab))) {
                int type = cursor.getInt(TYPE_COLUMN_INDEX);

                if (type != People.Phones.TYPE_CUSTOM) {
@@ -2126,9 +2139,28 @@ public final class ContactsListActivity extends ListActivity
                    // Don't check size, if it's zero just don't show anything
                    labelView.setText(cache.labelBuffer.data, 0, cache.labelBuffer.sizeCopied);
                }
                
                //Wysie_Soh: Set layout rules programmatically                    
                newNameLayout.addRule(RelativeLayout.ABOVE, R.id.label);
                newNumberLayout.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, 0);
                newNumberLayout.addRule(RelativeLayout.ALIGN_BASELINE, R.id.label);
                newNumberLayout.setMargins(5, 0, 0, 0);
                
                cache.nameView.setLayoutParams(newNameLayout);
                numberView.setLayoutParams(newNumberLayout);
                    
            } else {
                // There is no label, hide the the view
                labelView.setVisibility(View.GONE);
                
                //Wysie_Soh: Set layout rules programmatically                    
                newNameLayout.addRule(RelativeLayout.ABOVE, R.id.number);
                newNumberLayout.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
                newNumberLayout.addRule(RelativeLayout.ALIGN_BASELINE, 0);
                newNumberLayout.setMargins(0, -10, 0, 8);
                
                cache.nameView.setLayoutParams(newNameLayout);
                numberView.setLayoutParams(newNumberLayout);
            }

            // Set the proper icon (star or presence or nothing)
+36 −5
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ import android.widget.Button;
import android.view.View.OnClickListener;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.widget.RelativeLayout;

import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.ITelephony;
@@ -502,16 +503,46 @@ public class RecentCallsListActivity extends ListActivity
            // Set the text lines
            if (!TextUtils.isEmpty(name)) {
                views.line1View.setText(name);
                views.labelView.setVisibility(View.VISIBLE);
                //views.labelView.setVisibility(View.VISIBLE);
                CharSequence numberLabel = Phones.getDisplayLabel(context, ntype, label,
                        mLabelArray);
                        
                RelativeLayout.LayoutParams newLine1Layout = (RelativeLayout.LayoutParams) views.line1View.getLayoutParams();
                RelativeLayout.LayoutParams newNumberLayout = (RelativeLayout.LayoutParams) views.numberView.getLayoutParams();

                if (prefs.getBoolean("cl_show_number", true)) {       
                    views.numberView.setVisibility(View.VISIBLE);
                    views.numberView.setText(formattedNumber);
                if (!TextUtils.isEmpty(numberLabel)) {
                    views.labelView.setText(numberLabel);
                }
                else {
                    views.numberView.setVisibility(View.GONE);
                }
                
                
                if (!TextUtils.isEmpty(numberLabel) && prefs.getBoolean("cl_show_label", true)) {
                    views.labelView.setVisibility(View.VISIBLE);
                    views.labelView.setText(numberLabel);
                    
                    //Wysie_Soh: Set layout rules programmatically                    
                    newLine1Layout.addRule(RelativeLayout.ABOVE, R.id.label);
                    newNumberLayout.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, 0);
                    newNumberLayout.addRule(RelativeLayout.ALIGN_BASELINE, R.id.label);
                    newNumberLayout.setMargins(5, 0, 0, 0);                    
                    
                    views.line1View.setLayoutParams(newLine1Layout);
                    views.numberView.setLayoutParams(newNumberLayout);
                    
                } else {
                    views.labelView.setVisibility(View.GONE);
                    
                    //Wysie_Soh: Set layout rules programmatically                    
                    newLine1Layout.addRule(RelativeLayout.ABOVE, R.id.number);
                    newNumberLayout.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
                    newNumberLayout.addRule(RelativeLayout.ALIGN_BASELINE, 0);
                    newNumberLayout.setMargins(0, -10, 0, 8);                    
                    
                    views.line1View.setLayoutParams(newLine1Layout);
                    views.numberView.setLayoutParams(newNumberLayout);
                }
            } else {
                if (number.equals(CallerInfo.UNKNOWN_NUMBER)) {
+14 −0
Original line number Diff line number Diff line
@@ -145,6 +145,7 @@ public class ViewContactActivity extends ListActivity
    
    private static final int MENU_COPY_LABEL = 8;
    private static final int MENU_COPY_DATA = 9;
    private static final int MENU_COPY_NAME = 7;

    private Uri mUri;
    private ContentResolver mResolver;
@@ -244,6 +245,7 @@ public class ViewContactActivity extends ListActivity
        getListView().setOnCreateContextMenuListener(this);

        mNameView = (TextView) findViewById(R.id.name);
        mNameView.setOnCreateContextMenuListener(this);
        mPhoneticNameView = (TextView) findViewById(R.id.phonetic_name);
        mPhotoView = (ImageView) findViewById(R.id.photo);
        mStarView = (CheckBox) findViewById(R.id.star);
@@ -454,6 +456,13 @@ public class ViewContactActivity extends ListActivity

    @Override
    public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo) {
        switch (view.getId()) {
            case R.id.name: {
                menu.add(0, MENU_COPY_NAME, 0, "Copy name");
                return;
            }
        }
    
        AdapterView.AdapterContextMenuInfo info;
        try {
             info = (AdapterView.AdapterContextMenuInfo) menuInfo;
@@ -680,6 +689,11 @@ public class ViewContactActivity extends ListActivity
                 }
                 return true;
            }
            case MENU_COPY_NAME: {
                ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);                
                clipboard.setText(mNameView.getText().toString());
                break;
            }
            case MENU_COPY_LABEL: {
                AdapterView.AdapterContextMenuInfo info;
                try {