Skip to content

Commit

Permalink
Feature to select and delete multiple conversations.
Browse files Browse the repository at this point in the history
  • Loading branch information
JanisE committed Apr 22, 2017
1 parent 5f3856e commit ce4c344
Show file tree
Hide file tree
Showing 8 changed files with 488 additions and 100 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ SMSdroid is a light and fast app for reading and sending text messages.
It is optimized to play well with any app capable of sending messages.
A good example is [WebSMS](https://github.com/felixb/websms).

## Fork modifications

I've added a feature to select and bulk-delete many threads or conversations (as opposed to
deleting only one specific conversation or all SMSes on the device, which was already implemented).

## Issues and TODOs

I have no intention on tackling the issues or TODOs I've added to the code in the near future
and probably ever.

## Translation

Help translating this app to your favorite langauge on [crowdin](https://crowdin.com/project/smsdroid/invite)
2 changes: 1 addition & 1 deletion SMSdroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.android.tools.build:gradle:2.3.1'
}
}
apply plugin: 'com.android.application'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public class ConversationAdapter extends ResourceCursorAdapter {
/**
* View holder.
*/
private static class ViewHolder {
public static class ViewHolder {

TextView tvBody;

Expand All @@ -122,6 +122,28 @@ private static class ViewHolder {
ImageView ivPhoto;

View vRead;

View vSelected;

public void MarkConversationSelected () {
Log.d(TAG, "MarkConversationSelected()");

if (vSelected != null) {
vSelected.setVisibility(View.VISIBLE);
}
else {
Log.e(TAG, "Marking a (unexisting?) view which has no 'selected' view as selected.");
}
}

public void MarkConversationUnselected () {
if (vSelected != null) {
vSelected.setVisibility(View.INVISIBLE);
}
else {
Log.e(TAG, "Marking a (unexisting?) view which has no 'selected' view as unselected.");
}
}
}

/**
Expand Down Expand Up @@ -241,6 +263,7 @@ public final void bindView(final View view, final Context context, final Cursor
holder.tvDate = (TextView) view.findViewById(R.id.date);
holder.ivPhoto = (ImageView) view.findViewById(R.id.photo);
holder.vRead = view.findViewById(R.id.read);
holder.vSelected = view.findViewById(R.id.selected);
view.setTag(holder);
}

Expand Down Expand Up @@ -292,6 +315,12 @@ public final void bindView(final View view, final Context context, final Cursor
holder.vRead.setVisibility(View.INVISIBLE);
}

if (((ConversationListActivity) activity).isThreadSelected(c.getUri())) {
holder.MarkConversationSelected();
} else {
holder.MarkConversationUnselected();
}

// body
CharSequence text = c.getBody();
if (text == null) {
Expand Down
Loading

0 comments on commit ce4c344

Please sign in to comment.