Skip to content

Commit

Permalink
Merge pull request #216 from jlewis13/release_fixes
Browse files Browse the repository at this point in the history
Release fixes - final
  • Loading branch information
jlewis13 authored Oct 20, 2017
2 parents 055233f + 2dcb00d commit 0a43746
Show file tree
Hide file tree
Showing 11 changed files with 184 additions and 244 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ android {
applicationId 'io.forsta.relay'
minSdkVersion 14
targetSdkVersion 22
versionName "0.1.62"
versionCode 162
versionName "0.1.64"
versionCode 164
multiDexEnabled true
buildConfigField "long", "BUILD_TIMESTAMP", getLastCommitTimestamp() + "L"
resValue "string", "forsta_authorities", applicationId + '.provider.ccsm'
Expand Down
47 changes: 24 additions & 23 deletions res/layout/conversation_list_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,31 @@
android:orientation="vertical" android:layout_above="@id/layout_container"/>


<!--<LinearLayout-->
<!--android:id="@+id/left_drawer"-->
<!--android:layout_width="250dp"-->
<!--android:layout_height="match_parent"-->
<!--android:layout_gravity="left"-->
<!--android:background="@color/forsta_primary"-->
<!--android:orientation="vertical" android:visibility="gone">-->
<!--<FrameLayout-->
<!--android:id="@+id/forsta_drawer_left"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="match_parent" />-->
<!--</LinearLayout>-->

</RelativeLayout>
<LinearLayout
android:id="@+id/left_drawer"
android:layout_width="250dp"
android:layout_height="match_parent"
android:layout_gravity="left"
android:background="@color/forsta_primary"
android:orientation="vertical">
<FrameLayout
android:id="@+id/forsta_drawer_left"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>

<!--<LinearLayout-->
<!--android:id="@+id/right_drawer"-->
<!--android:layout_width="250dp"-->
<!--android:layout_height="match_parent"-->
<!--android:layout_gravity="right"-->
<!--android:background="@color/forsta_primary"-->
<!--android:orientation="vertical" android:visibility="gone">-->
<!--<FrameLayout-->
<!--android:id="@+id/forsta_drawer_right"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="match_parent" />-->
<!--android:id="@+id/right_drawer"-->
<!--android:layout_width="250dp"-->
<!--android:layout_height="match_parent"-->
<!--android:layout_gravity="right"-->
<!--android:background="@color/forsta_primary"-->
<!--android:orientation="vertical" android:visibility="gone">-->
<!--<FrameLayout-->
<!--android:id="@+id/forsta_drawer_right"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="match_parent" />-->
<!--</LinearLayout>-->
</RelativeLayout>
</android.support.v4.widget.DrawerLayout>
164 changes: 25 additions & 139 deletions res/layout/forsta_drawer_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,161 +7,47 @@
<LinearLayout
android:background="@color/forsta_accent4"
android:padding="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/forsta_drawer_user"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text=""
android:textAlignment="center"
android:textAllCaps="true"
android:textColor="@color/forsta_primary"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp">
android:layout_marginBottom="20dp">
<TextView
android:id="@+id/forsta_drawer_domain"
android:text="Domain"
android:text="Organization"
android:textAllCaps="true"
android:textColor="@color/forsta_primary"
android:textAlignment="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@color/forsta_accent">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/forsta_pop4"
android:paddingLeft="5dp"
android:paddingRight="5dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_forsta_conversations_light"/>
</FrameLayout>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Conversations"
android:textAllCaps="true"
android:textSize="10sp"
android:textAlignment="center"
android:layout_marginRight="30dp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp">

</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@color/forsta_accent">
<FrameLayout
android:orientation="horizontal">
<io.forsta.securesms.components.AvatarImageView
android:id="@+id/drawer_photo_image"
android:layout_width="@dimen/contact_selection_photo_size"
android:layout_height="@dimen/contact_selection_photo_size"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:cropToPadding="true"
android:scaleType="centerCrop"
android:layout_marginRight="20dp"
android:contentDescription="@string/SingleContactSelectionActivity_contact_photo" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/forsta_pop"
android:paddingLeft="5dp"
android:paddingRight="5dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_forsta_pin_light"/>
</FrameLayout>
android:layout_height="wrap_content" android:orientation="vertical">
<TextView android:id="@+id/drawer_user"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/TextAppearance.AppCompat.Subhead"/>
<TextView android:id="@+id/drawer_org_tag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Pinned"
android:textAllCaps="true"
android:textSize="10sp"
android:textAlignment="center"
android:layout_marginRight="30dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp">

</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@color/forsta_accent">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/forsta_pop2"
android:paddingLeft="5dp"
android:paddingRight="5dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_forsta_announcements_light"/>
</FrameLayout>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Announcements"
android:textAllCaps="true"
android:textSize="10sp"
android:textAlignment="center"
android:layout_marginRight="30dp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp">

</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@color/forsta_accent">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/forsta_pop3"
android:paddingLeft="5dp"
android:paddingRight="5dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_forsta_topic_light"/>
</FrameLayout>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Topics"
android:textAllCaps="true"
android:textSize="10sp"
android:textAlignment="center"
android:layout_marginRight="30dp"/>
</LinearLayout>
</LinearLayout>

Expand Down
6 changes: 6 additions & 0 deletions src/io/forsta/ccsm/DashboardActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@

import io.forsta.ccsm.api.CcsmApi;
import io.forsta.securesms.util.GroupUtil;
import io.forsta.securesms.util.TextSecurePreferences;


// TODO Remove all of this code for production release. This is for discovery and debug use.
Expand Down Expand Up @@ -327,6 +328,9 @@ private void printLoginInformation() {
sb.append("Phone: ");
sb.append(user.phone);
sb.append("\n");
sb.append("Device ID: ");
sb.append(TextSecurePreferences.getLocalDeviceId(DashboardActivity.this));
sb.append("\n");

mLoginInfo.setText(sb.toString());
}
Expand Down Expand Up @@ -425,6 +429,8 @@ private String printIdentities() {

private String printThreads() {
StringBuilder sb = new StringBuilder();
SmsDatabase smsDb = DatabaseFactory.getSmsDatabase(DashboardActivity.this);
sb.append("SMS message count:" + smsDb.getMessageCount()).append("\n");
ThreadDatabase tdb = DatabaseFactory.getThreadDatabase(DashboardActivity.this);
Cursor cursor = tdb.getConversationList();
while (cursor != null && cursor.moveToNext()) {
Expand Down
25 changes: 22 additions & 3 deletions src/io/forsta/ccsm/DrawerFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@
import android.view.ViewGroup;
import android.widget.TextView;

import io.forsta.ccsm.database.model.ForstaUser;
import io.forsta.securesms.R;
import io.forsta.securesms.components.AvatarImageView;
import io.forsta.securesms.contacts.avatars.ContactPhoto;
import io.forsta.securesms.crypto.MasterSecret;
import io.forsta.securesms.recipients.RecipientFactory;
import io.forsta.securesms.recipients.Recipients;

/**
* Created by jlewis on 5/19/17.
Expand All @@ -18,7 +23,11 @@
public class DrawerFragment extends Fragment {
private static final String TAG = DrawerFragment.class.getSimpleName();
private MasterSecret masterSecret;
private TextView domainName;
private TextView orgName;
private TextView userName;
private TextView orgTag;
private AvatarImageView contactPhotoImage;
private Recipients recipients;

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
Expand All @@ -29,9 +38,19 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

final View view = inflater.inflate(R.layout.forsta_drawer_fragment, container, false);
domainName = (TextView) view.findViewById(R.id.forsta_drawer_domain);
domainName.setText("DOMAIN: " + ForstaPreferences.getForstaOrgName(getActivity()));
orgName = (TextView) view.findViewById(R.id.forsta_drawer_domain);
userName = (TextView) view.findViewById(R.id.drawer_user);
orgTag = (TextView) view.findViewById(R.id.drawer_org_tag);
contactPhotoImage = (AvatarImageView) view.findViewById(R.id.drawer_photo_image);

ForstaUser user = ForstaUser.getLocalForstaUser(getActivity());
recipients = RecipientFactory.getRecipientsFromString(getActivity(), user.getUid(), false);
userName.setText(user.getName());
orgTag.setText("@" + user.getTag() + ": " + user.getOrgTag());
contactPhotoImage.setAvatar(recipients, true);
orgName.setText(user.getOrgTag());

return view;
}
Expand Down
8 changes: 4 additions & 4 deletions src/io/forsta/securesms/ConversationFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,10 @@ protected Void doInBackground(MessageRecord... messageRecords) {
threadDeleted = DatabaseFactory.getSmsDatabase(getActivity()).deleteMessage(messageRecord.getId());
}

if (threadDeleted) {
threadId = -1;
listener.setThreadId(threadId);
}
// if (threadDeleted) {
// threadId = -1;
// listener.setThreadId(threadId);
// }
}

return null;
Expand Down
5 changes: 4 additions & 1 deletion src/io/forsta/securesms/ConversationListActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ protected void onSaveInstanceState(Bundle outState) {
@Override
protected void onCreate(Bundle savedState, @NonNull MasterSecret masterSecret) {
localUser = ForstaUser.getLocalForstaUser(ConversationListActivity.this);
Log.w(TAG, "User: " + localUser.getFullTag());
Log.w(TAG, "ID: " + localUser.getUid() + " Device ID: " + TextSecurePreferences.getLocalDeviceId(ConversationListActivity.this));

this.masterSecret = masterSecret;
setContentView(R.layout.conversation_list_activity);
getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
Expand All @@ -101,7 +104,7 @@ protected void onCreate(Bundle savedState, @NonNull MasterSecret masterSecret) {
syncReceiver = new ContactsSyncReceiver();
registerReceiver(syncReceiver, syncIntentFilter);
fragment = initFragment(R.id.forsta_conversation_list, new ConversationListFragment(), masterSecret, dynamicLanguage.getCurrentLocale());
// drawerFragment = initFragment(R.id.forsta_drawer_left, new DrawerFragment(), masterSecret, dynamicLanguage.getCurrentLocale());
drawerFragment = initFragment(R.id.forsta_drawer_left, new DrawerFragment(), masterSecret, dynamicLanguage.getCurrentLocale());

RefreshUserOrg task = new RefreshUserOrg();
task.execute();
Expand Down
Loading

0 comments on commit 0a43746

Please sign in to comment.