android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
- <FrameLayout android:id="@android:id/tabcontent"
+ <ListView android:id="@+id/contact_data"
android:layout_width="fill_parent"
- android:layout_height="0dip"
- android:layout_weight="1">
-
- <View
+ android:layout_height="fill_parent"
+ android:background="@drawable/title_bar_shadow"
+ />
+
+ <ScrollView android:id="@android:id/empty"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:fillViewport="true"
+ >
+ <TextView android:id="@+id/emptyText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:background="@drawable/title_bar_shadow"
+ android:text="@string/no_contact_details"
+ android:textSize="20sp"
+ android:textColor="?android:attr/textColorSecondary"
+ android:paddingLeft="10dip"
+ android:paddingRight="10dip"
+ android:paddingTop="10dip"
+ android:lineSpacingMultiplier="0.92"
/>
- </FrameLayout>
+ </ScrollView>
</LinearLayout>
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.ListView;
+import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
finish();
}
- private FrameLayout mTabContentLayout;
private ListView mListView;
private boolean mShowSmsLinksForAllPhones;
mHandler = new NotifyingAsyncQueryHandler(this, this);
- mListView = new ListView(this);
+ mListView = (ListView) findViewById(R.id.contact_data);
mListView.setOnCreateContextMenuListener(this);
mListView.setScrollBarStyle(ListView.SCROLLBARS_OUTSIDE_OVERLAY);
mListView.setOnItemClickListener(this);
-
- mTabContentLayout = (FrameLayout) findViewById(android.R.id.tabcontent);
- mTabContentLayout.addView(mListView);
+ mListView.setEmptyView((ScrollView) findViewById(android.R.id.empty));
mResolver = getContentResolver();
.setPositiveButton(android.R.string.ok, this)
.setCancelable(false)
.create();
- case DIALOG_CONFIRM_READONLY_HIDE: {
+ case DIALOG_CONFIRM_READONLY_HIDE: {
return new AlertDialog.Builder(this)
.setTitle(R.string.deleteConfirmation_title)
.setIcon(android.R.drawable.ic_dialog_alert)
.setMessage(R.string.readOnlyContactWarning)
.setPositiveButton(android.R.string.ok, this)
- .create();
+ .create();
}
}
}
case R.id.menu_delete: {
// Get confirmation
- if (mReadOnlySourcesCnt > 0 & mWritableSourcesCnt > 0) {
+ if (mReadOnlySourcesCnt > 0 & mWritableSourcesCnt > 0) {
showDialog(DIALOG_CONFIRM_READONLY_DELETE);
- } else if (mReadOnlySourcesCnt > 0 && mWritableSourcesCnt == 0) {
+ } else if (mReadOnlySourcesCnt > 0 && mWritableSourcesCnt == 0) {
showDialog(DIALOG_CONFIRM_READONLY_HIDE);
- } else if (mReadOnlySourcesCnt == 0 && mWritableSourcesCnt > 1) {
- showDialog(DIALOG_CONFIRM_MULTIPLE_DELETE);
- } else {
- showDialog(DIALOG_CONFIRM_DELETE);
- }
+ } else if (mReadOnlySourcesCnt == 0 && mWritableSourcesCnt > 1) {
+ showDialog(DIALOG_CONFIRM_MULTIPLE_DELETE);
+ } else {
+ showDialog(DIALOG_CONFIRM_DELETE);
+ }
return true;
}
case R.id.menu_join: {
}
case KeyEvent.KEYCODE_DEL: {
- if (mReadOnlySourcesCnt > 0 & mWritableSourcesCnt > 0) {
+ if (mReadOnlySourcesCnt > 0 & mWritableSourcesCnt > 0) {
showDialog(DIALOG_CONFIRM_READONLY_DELETE);
- } else if (mReadOnlySourcesCnt > 0 && mWritableSourcesCnt == 0) {
+ } else if (mReadOnlySourcesCnt > 0 && mWritableSourcesCnt == 0) {
showDialog(DIALOG_CONFIRM_READONLY_HIDE);
- } else if (mReadOnlySourcesCnt == 0 && mWritableSourcesCnt > 1) {
- showDialog(DIALOG_CONFIRM_MULTIPLE_DELETE);
- } else {
- showDialog(DIALOG_CONFIRM_DELETE);
- }
+ } else if (mReadOnlySourcesCnt == 0 && mWritableSourcesCnt > 1) {
+ showDialog(DIALOG_CONFIRM_MULTIPLE_DELETE);
+ } else {
+ showDialog(DIALOG_CONFIRM_DELETE);
+ }
return true;
}
}
mReadOnlySourcesCnt += 1;
} else {
mWritableSourcesCnt += 1;
- mWritableRawContactIds.add(rawContactId);
- }
+ mWritableRawContactIds.add(rawContactId);
+ }
for (NamedContentValues subValue : entity.getSubValues()) {