Skip to content

Commit

Permalink
Merge branch 'groups' of github.com:WhisperSystems/TextSecure into gr…
Browse files Browse the repository at this point in the history
…oups
  • Loading branch information
moxie0 committed Feb 3, 2014
2 parents 0ace469 + 9fd2c47 commit 0af473d
Show file tree
Hide file tree
Showing 44 changed files with 1,040 additions and 6 deletions.
10 changes: 10 additions & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@
android:windowSoftInputMode="stateUnchanged"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>

<activity android:name=".GroupCreateActivity"
android:windowSoftInputMode="stateVisible"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>

<activity android:name=".DatabaseMigrationActivity"
android:theme="@style/NoAnimation.Theme.Sherlock.Light.DarkActionBar"
android:launchMode="singleTask"
Expand Down Expand Up @@ -130,6 +134,12 @@
android:windowSoftInputMode="stateHidden"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>


<activity android:name=".PushContactSelectionActivity"
android:label="@string/AndroidManifest__select_contacts"
android:windowSoftInputMode="stateHidden"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>

<activity android:name=".AutoInitiateActivity"
android:theme="@style/TextSecure.Light.Dialog"
android:label="@string/AndroidManifest__textsecure_detected"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,16 @@ public class Directory {
SUPPORTS_SMS + " INTEGER, " +
TIMESTAMP + " INTEGER);";

private static Directory instance;
private static final Object instanceLock = new Object();
private static volatile Directory instance;

public synchronized static Directory getInstance(Context context) {
public static Directory getInstance(Context context) {
if (instance == null) {
instance = new Directory(context);
synchronized (instanceLock) {
if (instance == null) {
instance = new Directory(context);
}
}
}

return instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class PushServiceSocket {
private static final String MESSAGE_PATH = "/v1/messages/%s";
private static final String ATTACHMENT_PATH = "/v1/attachments/%s";

private static final boolean ENFORCE_SSL = false;
private static final boolean ENFORCE_SSL = true;

private final Context context;
private final String serviceUrl;
Expand Down
Binary file added res/drawable-hdpi/ic_action_add_group_holo_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_action_add_group_holo_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_menu_accept_holo_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_menu_accept_holo_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_menu_remove_holo_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_action_add_group_holo_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_action_add_group_holo_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_menu_accept_holo_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_menu_accept_holo_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_menu_remove_holo_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_menu_accept_holo_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_menu_accept_holo_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_menu_remove_holo_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_action_add_person.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_menu_accept_holo_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_menu_accept_holo_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_menu_remove_holo_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions res/layout/group_create_activity.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="20dp">

<EditText
android:id="@+id/group_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:hint="Group name"
android:layout_marginBottom="20dp" />

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<EditText
android:id="@+id/group_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Add people"
android:padding="10dp" />

<ImageButton
android:id="@+id/add_people_button"
android:background="#00ffffff"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="15dp"
android:src="@drawable/ic_action_add_person"
android:layout_alignParentRight="true" />

</RelativeLayout>

<ListView
android:id="@+id/selected_contacts_list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

</LinearLayout>
16 changes: 16 additions & 0 deletions res/layout/push_contact_selection_activity.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:layout_gravity="center"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android">

<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/contact_selection_list_fragment"
android:name="org.thoughtcrime.securesms.PushContactSelectionListFragment">
</fragment>

</LinearLayout>
20 changes: 20 additions & 0 deletions res/layout/push_contact_selection_list_activity.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">

<ListView android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fastScrollEnabled="true" />

<TextView android:id="@android:id/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center|center_vertical"
android:layout_marginTop="15dp"
android:text="@string/contact_selection_group_activity__finding_contacts"
android:textSize="20sp" />

</LinearLayout>
60 changes: 60 additions & 0 deletions res/layout/push_contact_selection_list_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:paddingLeft="14dip"
android:paddingRight="25dip">

<TextView android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="8dip"
android:layout_marginTop="-8dip"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold"
android:visibility = "gone"
/>

<TextView android:id="@+id/number"
android:visibility = "visible"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dip"
android:layout_marginTop="-8dip"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceSmall"
android:fontFamily="sans-serif-light"
/>

<TextView android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@id/number"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="1dip"
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
android:singleLine="true"
android:ellipsize="marquee"
android:gravity="center_vertical|left"
android:textAppearance="?android:attr/textAppearanceMedium"
/>

<CheckBox
android:id="@+id/check_box"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="13dp"
android:focusable="false"
android:clickable="false" />

</RelativeLayout>
34 changes: 34 additions & 0 deletions res/layout/selected_recipient_list_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:padding="10dp">

<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
android:id="@+id/phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@id/name"
android:textAppearance="?android:attr/textAppearanceSmall"
android:fontFamily="sans-serif-light" />

<ImageButton
android:id="@+id/delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="#00ffffff"
android:src="@drawable/ic_menu_remove_holo_light" />

</RelativeLayout>
10 changes: 10 additions & 0 deletions res/menu/group_create.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>

<menu xmlns:android="http://schemas.android.com/apk/res/android">

<item android:title="CREATE"
android:id="@+id/menu_create_group"
android:icon="@drawable/ic_menu_accept_holo_light"
android:showAsAction="always|withText"/>

</menu>
4 changes: 4 additions & 0 deletions res/menu/text_secure_normal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
android:icon="?attr/menu_new_conversation_icon"
android:showAsAction="always" />

<item android:title="New Group"
android:id="@+id/menu_new_group"
android:icon="?attr/menu_new_group_icon" />

<item android:title="@string/text_secure_normal__menu_clear_passphrase"
android:id="@+id/menu_clear_passphrase"
android:icon="@android:drawable/ic_menu_close_clear_cancel" />
Expand Down
1 change: 1 addition & 0 deletions res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<attr name="navigation_drawer_shadow" format="reference"/>

<attr name="menu_new_conversation_icon" format="reference" />
<attr name="menu_new_group_icon" format="reference" />
<attr name="menu_search_icon" format="reference" />
<attr name="menu_call_icon" format="reference" />
<attr name="menu_unlock_icon" format="reference" />
Expand Down
3 changes: 2 additions & 1 deletion res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@
<!-- contact_selection_group_activity -->
<!-- contact_selection_list_activity -->
<string name="contact_selection_group_activity__no_contacts">No contacts.</string>

<string name="contact_selection_group_activity__finding_contacts">Finding contacts...</string>

<!-- ContactSelectionListFragment-->
<string name="ContactSelectionlistFragment_select_for">Select for</string>

Expand Down
2 changes: 2 additions & 0 deletions res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<item name="conversation_keyboard_toggle">@drawable/ic_ime_dark</item>

<item name="menu_new_conversation_icon">@drawable/ic_action_new_holo_light</item>
<item name="menu_new_group_icon">@drawable/ic_action_add_group_holo_light</item>
<item name="menu_search_icon">@drawable/ic_menu_search_holo_light</item>
<item name="menu_call_icon">@drawable/ic_menu_call_holo_light</item>
<item name="menu_unlock_icon">@drawable/ic_menu_unlock_holo_light</item>
Expand Down Expand Up @@ -75,6 +76,7 @@
<item name="conversation_keyboard_toggle">@drawable/ic_ime_light</item>

<item name="menu_new_conversation_icon">@drawable/ic_action_new_holo_dark</item>
<item name="menu_new_group_icon">@drawable/ic_action_add_group_holo_dark</item>
<item name="menu_search_icon">@drawable/ic_menu_search_holo_dark</item>
<item name="menu_call_icon">@drawable/ic_menu_call_holo_dark</item>
<item name="menu_unlock_icon">@drawable/ic_menu_unlock_holo_dark</item>
Expand Down
1 change: 0 additions & 1 deletion src/org/thoughtcrime/securesms/ConversationActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,6 @@ private void initializeRecipientsInput() {
}
}


private void initializeReceivers() {
securityUpdateReceiver = new BroadcastReceiver() {
@Override
Expand Down
1 change: 1 addition & 0 deletions src/org/thoughtcrime/securesms/ConversationFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ private void handleDisplayDetails(MessageRecord message) {
long dateReceived = message.getDateReceived();
long dateSent = message.getDateSent();


SimpleDateFormat dateFormatter = new SimpleDateFormat("EEE MMM d, yyyy 'at' hh:mm:ss a zzz");
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle(R.string.ConversationFragment_message_details);
Expand Down
6 changes: 6 additions & 0 deletions src/org/thoughtcrime/securesms/ConversationListActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public boolean onOptionsItemSelected(MenuItem item) {

switch (item.getItemId()) {
case R.id.menu_new_message: createConversation(-1, null, defaultType); return true;
case R.id.menu_new_group: createGroup(); return true;
case R.id.menu_settings: handleDisplaySettings(); return true;
case R.id.menu_clear_passphrase: handleClearPassphrase(); return true;
case R.id.menu_mark_all_read: handleMarkAllRead(); return true;
Expand All @@ -153,6 +154,11 @@ public void onCreateConversation(long threadId, Recipients recipients, int distr
createConversation(threadId, recipients, distributionType);
}

private void createGroup() {
Intent intent = new Intent(this, GroupCreateActivity.class);
startActivity(intent);
}

private void createConversation(long threadId, Recipients recipients, int distributionType) {
Intent intent = new Intent(this, ConversationActivity.class);
intent.putExtra(ConversationActivity.RECIPIENTS_EXTRA, recipients);
Expand Down
Loading

0 comments on commit 0af473d

Please sign in to comment.