Skip to content
This repository was archived by the owner on Aug 19, 2021. It is now read-only.

Commit 7c5b1d5

Browse files
author
Michael Farb
committed
consolidated passphrase change to one view
- Fixed #22 change passphrase should be completed all on one screen
1 parent c6a6d15 commit 7c5b1d5

11 files changed

Lines changed: 193 additions & 142 deletions

File tree

safeslinger-demo/build.gradle

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
apply plugin: 'android'
3+
4+
android {
5+
compileSdkVersion 19
6+
buildToolsVersion '19.1'
7+
8+
defaultConfig {
9+
minSdkVersion 4
10+
}
11+
sourceSets {
12+
main {
13+
manifest.srcFile 'AndroidManifest.xml'
14+
java.srcDirs = ['src']
15+
res.srcDirs = ['res']
16+
}
17+
}
18+
lintOptions {
19+
abortOnError false
20+
}
21+
dependencies {
22+
compile project(':safeslinger-exchange')
23+
}
24+
}
-633 KB
Binary file not shown.

safeslinger-messenger/res/layout-land/passphrase.xml

Lines changed: 73 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -32,52 +32,11 @@
3232
android:orientation="vertical"
3333
android:weightSum="2" >
3434

35-
<LinearLayout
36-
android:id="@+id/TopFrame"
37-
android:layout_width="fill_parent"
38-
android:layout_height="0dp"
39-
android:layout_margin="@dimen/size_5dp"
40-
android:layout_weight="0.75"
41-
android:orientation="horizontal"
42-
android:weightSum="2" >
43-
44-
<ImageView
45-
android:id="@+id/PassImageViewCylab"
46-
android:layout_width="0dp"
47-
android:layout_height="wrap_content"
48-
android:layout_weight="1.00"
49-
android:contentDescription="@string/label_Photo"
50-
android:scaleType="fitStart"
51-
android:src="@drawable/logo_cylab_large" >
52-
</ImageView>
53-
54-
<ImageView
55-
android:id="@+id/PassImageViewIcon"
56-
android:layout_width="0dp"
57-
android:layout_height="wrap_content"
58-
android:layout_gravity="center_vertical"
59-
android:layout_weight="0.95"
60-
android:contentDescription="@string/label_Photo"
61-
android:src="@drawable/logo_safeslinger_large" >
62-
</ImageView>
63-
64-
<ImageButton
65-
android:id="@+id/PassButtonHelp"
66-
android:layout_width="wrap_content"
67-
android:layout_height="wrap_content"
68-
android:layout_gravity="top|right"
69-
android:layout_weight="0.05"
70-
android:background="@color/white"
71-
android:contentDescription="@string/menu_Help"
72-
android:src="@drawable/ic_information" />
73-
</LinearLayout>
74-
7535
<LinearLayout
7636
android:id="@+id/BottomFrame"
7737
android:layout_width="fill_parent"
78-
android:layout_height="0dp"
38+
android:layout_height="match_parent"
7939
android:layout_margin="@dimen/size_5dp"
80-
android:layout_weight="1.25"
8140
android:orientation="horizontal"
8241
android:weightSum="2" >
8342

@@ -89,23 +48,56 @@
8948
android:layout_weight="1"
9049
android:orientation="vertical" >
9150

92-
<TextView
93-
android:id="@+id/PassTextViewAppName"
51+
<ImageView
52+
android:id="@+id/PassImageViewCylab"
53+
android:layout_width="match_parent"
54+
android:layout_height="0dp"
55+
android:layout_margin="@dimen/size_5dp"
56+
android:layout_weight="3"
57+
android:contentDescription="@string/label_Photo"
58+
android:scaleType="fitStart"
59+
android:src="@drawable/logo_cylab_large" />
60+
61+
<LinearLayout
62+
android:id="@+id/TitleFrame"
9463
android:layout_width="fill_parent"
9564
android:layout_height="wrap_content"
96-
android:gravity="center_horizontal|bottom"
97-
android:text="@string/app_name"
98-
android:textSize="@dimen/text_size_40" >
99-
</TextView>
65+
android:layout_margin="@dimen/size_5dp"
66+
android:orientation="vertical" >
10067

101-
<TextView
102-
android:id="@+id/PassTextViewVersion"
103-
android:layout_width="fill_parent"
104-
android:layout_height="wrap_content"
105-
android:gravity="center_horizontal|top"
106-
android:textIsSelectable="false"
107-
android:textSize="@dimen/text_size_small" >
108-
</TextView>
68+
<TextView
69+
android:id="@+id/PassTextViewAppName"
70+
android:layout_width="fill_parent"
71+
android:layout_height="match_parent"
72+
android:gravity="center_horizontal|bottom"
73+
android:text="@string/app_name"
74+
android:textSize="@dimen/text_size_40" />
75+
76+
<TextView
77+
android:id="@+id/PassTextViewVersion"
78+
android:layout_width="fill_parent"
79+
android:layout_height="wrap_content"
80+
android:gravity="center_horizontal|top"
81+
android:textIsSelectable="false"
82+
android:textSize="@dimen/text_size_small" />
83+
</LinearLayout>
84+
85+
<LinearLayout
86+
android:layout_width="match_parent"
87+
android:layout_height="0dp"
88+
android:layout_weight="4"
89+
android:orientation="horizontal" >
90+
91+
<ImageView
92+
android:id="@+id/PassImageViewIcon"
93+
android:layout_width="0dp"
94+
android:layout_height="match_parent"
95+
android:layout_weight="0.90"
96+
android:contentDescription="@string/app_name"
97+
android:scaleType="fitCenter"
98+
android:src="@drawable/logo_safeslinger_large" >
99+
</ImageView>
100+
</LinearLayout>
109101

110102
<RelativeLayout
111103
android:id="@+id/MenuFrame"
@@ -116,8 +108,11 @@
116108
android:id="@+id/PassFrameButtonForgot"
117109
android:layout_width="wrap_content"
118110
android:layout_height="wrap_content"
119-
android:layout_alignParentBottom="true"
120-
android:layout_alignParentLeft="true" >
111+
android:layout_alignParentLeft="true"
112+
android:layout_alignParentTop="true"
113+
android:layout_gravity="bottom|right"
114+
android:layout_marginBottom="@dimen/size_5dp"
115+
android:layout_marginTop="@dimen/size_5dp" >
121116

122117
<Button
123118
android:id="@+id/PassButtonForgot"
@@ -133,6 +128,16 @@
133128
android:textIsSelectable="false"
134129
android:textSize="@dimen/text_size_small" />
135130
</RelativeLayout>
131+
132+
<ImageButton
133+
android:id="@+id/PassButtonHelp"
134+
android:layout_width="wrap_content"
135+
android:layout_height="wrap_content"
136+
android:layout_alignParentRight="true"
137+
android:layout_centerVertical="true"
138+
android:background="@color/white"
139+
android:contentDescription="@string/menu_Help"
140+
android:src="@drawable/ic_information" />
136141
</RelativeLayout>
137142
</LinearLayout>
138143

@@ -152,6 +157,16 @@
152157
android:textSize="@dimen/text_size_small" >
153158
</Spinner>
154159

160+
<EditText
161+
android:id="@+id/EditTextPassphraseConfirm"
162+
android:layout_width="fill_parent"
163+
android:layout_height="wrap_content"
164+
android:hint="@string/label_PassHintCurrent"
165+
android:imeOptions="actionNext"
166+
android:inputType="textPassword"
167+
android:privateImeOptions="nm"
168+
android:textSize="@dimen/text_size_msg" />
169+
155170
<EditText
156171
android:id="@+id/EditTextPassphrase"
157172
android:layout_width="fill_parent"

safeslinger-messenger/res/layout/passphrase.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,16 @@
8080
android:textSize="@dimen/text_size_small" >
8181
</Spinner>
8282

83+
<EditText
84+
android:id="@+id/EditTextPassphraseConfirm"
85+
android:layout_width="fill_parent"
86+
android:layout_height="wrap_content"
87+
android:hint="@string/label_PassHintCurrent"
88+
android:imeOptions="actionNext"
89+
android:inputType="textPassword"
90+
android:privateImeOptions="nm"
91+
android:textSize="@dimen/text_size_msg" />
92+
8393
<EditText
8494
android:id="@+id/EditTextPassphrase"
8595
android:layout_width="fill_parent"

safeslinger-messenger/src/edu/cmu/cylab/starslinger/SafeSlingerConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ public static final class extra {
162162
public static final String MESSAGE_ROW_ID = "MessageRowId";
163163
public static final String INBOX_ROW_ID = "InboxRowId";
164164
public static final String NAME = "Name";
165-
public static final String PASS_PHRASE = "PassPhrase";
165+
public static final String PASS_PHRASE_NEW = "PassPhraseNew";
166+
public static final String PASS_PHRASE_OLD = "PassPhraseOld";
166167
public static final String PCT = "pct";
167168
public static final String PHOTO = "Photo";
168169
public static final String POSITION = "Position";
@@ -185,7 +186,6 @@ public static final class extra {
185186
public static final String TEXT_MESSAGE2 = "TextMessage2";
186187
public static final String THUMBNAIL = "Thumbnail";
187188
public static final String USER_TOTAL = "UserTotal";
188-
public static final String VERIFY_PASS_PHRASE = "VerifyPassPhrase";
189189
public static final String RECIP_SOURCE = "RecipientSource";
190190
public static final String KEYID = "KeyId";
191191
public static final String INTRO_PUBKEY = "IntroPubKey";

safeslinger-messenger/src/edu/cmu/cylab/starslinger/Service.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ public Notification createBackupDelayNotification(long request) {
243243
.setWhen(request)//
244244
.setAutoCancel(true)//
245245
.setContentTitle(contentTitle)//
246-
.setContentText(contentText)
247-
.setVisibility(NotificationCompat.VISIBILITY_SECRET);;
246+
.setContentText(contentText)//
247+
.setVisibility(NotificationCompat.VISIBILITY_SECRET);
248248

249249
return builder.build();
250250
}
@@ -276,7 +276,7 @@ public Notification createCacheNotification() {
276276
.setTicker(tickerText)//
277277
.setContentTitle(contentTitle)//
278278
.setContentText(contentText)//
279-
.setWhen(0)
279+
.setWhen(0)//
280280
.setVisibility(NotificationCompat.VISIBILITY_SECRET);
281281

282282
return builder.build();
@@ -300,7 +300,7 @@ public Notification createSlingKeysReminderNotification() {
300300
.setTicker(tickerText)//
301301
.setContentTitle(contentTitle)//
302302
.setContentText(contentText)//
303-
.setWhen(0)
303+
.setWhen(0)//
304304
.setVisibility(NotificationCompat.VISIBILITY_SECRET);
305305

306306
return builder.build();

safeslinger-messenger/src/edu/cmu/cylab/starslinger/model/RecipientDbAdapter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,13 @@ private int delete(String table, String whereClause, String[] whereArgs) {
176176

177177
private Cursor query(String table, String[] columns, String selection, String[] selectionArgs,
178178
String groupBy, String having, String orderBy) {
179+
180+
// TODO: Caused by: java.lang.IllegalStateException: attempt to re-open
181+
// an already-closed object: SQLiteDatabase:
182+
// /data/data/edu.cmu.cylab.starslinger/databases/safeslinger.recipient
179183
Cursor query = mDatabase.query(table, columns, selection, selectionArgs, groupBy, having,
180184
orderBy);
185+
181186
// if (query != null) {
182187
// MyLog.d(TAG, query.getCount() + " " + table + " " + selection + " " +
183188
// selectionArgs

safeslinger-messenger/src/edu/cmu/cylab/starslinger/util/NotificationBroadcastReceiver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ public static void doUnseenMessagesNotification(Context ctx, int msgCount,
9393
.setAutoCancel(true)//
9494
.setContentTitle(contentTitle)//
9595
.setContentText(contentText)//
96-
.setNumber(visibleMsgCount)
97-
.setVisibility(NotificationCompat.VISIBILITY_SECRET);; // API 11+
96+
.setNumber(visibleMsgCount)//
97+
.setVisibility(NotificationCompat.VISIBILITY_SECRET);
9898

9999
try {
100100
builder.setLargeIcon(BitmapFactory.decodeResource(ctx.getResources(),

safeslinger-messenger/src/edu/cmu/cylab/starslinger/view/FindContactActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ private void doValidatePassphrase() {
249249
return;
250250
}
251251

252-
Intent data = new Intent().putExtra(extra.PASS_PHRASE, passPhrase2);
252+
Intent data = new Intent();
253+
data.putExtra(extra.PASS_PHRASE_NEW, passPhrase2);
253254
setResult(RESULT_OK, data);
254255
finish();
255256
}

0 commit comments

Comments
 (0)