Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit 3829724

Browse files
committed
Add highlight and show how to use some features
1 parent 958e3e8 commit 3829724

20 files changed

+503
-3
lines changed

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ dependencies {
7575
compile 'commons-lang:commons-lang:2.6'
7676
compile 'org.ccil.cowan.tagsoup:tagsoup:1.2.1'
7777
compile 'com.squareup.picasso:picasso:2.5.2'
78+
compile 'com.github.amlcurran.showcaseview:library:5.4.3'
7879
compile('com.crashlytics.sdk.android:crashlytics:2.6.2@aar') {
7980
transitive = true;
8081
}

app/src/debug/res/show_feature.xml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:orientation="vertical" android:layout_width="match_parent"
4+
android:layout_height="match_parent">
5+
<ImageView
6+
android:layout_width="match_parent"
7+
android:layout_height="match_parent"
8+
android:layout_marginBottom="40dp"
9+
android:src="@drawable/privatechat"
10+
android:layout_alignParentBottom="true" />
11+
12+
<TextView
13+
android:layout_width="50dp"
14+
android:layout_height="20dp"
15+
android:id="@+id/private_chat"
16+
android:layout_marginTop="60dp"
17+
android:layout_marginLeft="80dp"
18+
android:layout_alignParentTop="true"
19+
android:layout_alignParentLeft="true"
20+
android:layout_alignParentStart="true" />
21+
22+
<TextView
23+
android:layout_width="20dp"
24+
android:layout_height="20dp"
25+
26+
android:layout_marginTop="60dp"
27+
android:layout_marginLeft="120dp"
28+
android:id="@+id/press_button"
29+
android:layout_alignParentTop="true"
30+
android:layout_toRightOf="@+id/search_view"
31+
android:layout_toEndOf="@+id/search_view" />
32+
33+
<TextView
34+
android:layout_width="150dp"
35+
android:layout_height="100dp"
36+
android:id="@+id/results"
37+
android:layout_marginLeft="80dp"
38+
android:layout_alignParentBottom="true"
39+
android:layout_alignParentLeft="true"
40+
android:layout_alignParentStart="true"
41+
android:layout_marginBottom="200dp" />
42+
43+
<Button
44+
android:layout_width="wrap_content"
45+
android:layout_height="wrap_content"
46+
android:text="Continue"
47+
android:id="@+id/button"
48+
android:layout_alignParentBottom="true"
49+
android:layout_centerHorizontal="true" />
50+
51+
</RelativeLayout>

app/src/main/AndroidManifest.xml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.zulip.android"
4-
>
3+
package="com.zulip.android">
54

65
<uses-permission android:name="android.permission.INTERNET" />
76
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
@@ -32,6 +31,38 @@
3231

3332
<category android:name="android.intent.category.LAUNCHER" />
3433
</intent-filter>
34+
35+
</activity>
36+
37+
<activity
38+
android:name=".activities.MessageExplain"
39+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
40+
android:label="@string/app_name"
41+
android:launchMode="singleTask" >
42+
43+
</activity>
44+
45+
<activity
46+
android:name=".activities.ShowFeature"
47+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
48+
android:label="@string/app_name"
49+
android:launchMode="singleTask" >
50+
51+
</activity>
52+
<activity
53+
android:name=".activities.ChatBoxFeature"
54+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
55+
android:label="@string/app_name"
56+
android:launchMode="singleTask" >
57+
58+
</activity>
59+
60+
<activity
61+
android:name=".activities.StreamPicker"
62+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
63+
android:label="@string/app_name"
64+
android:launchMode="singleTask" >
65+
3566
</activity>
3667
<activity
3768
android:name=".activities.LoginActivity"
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
package com.zulip.android.activities;
2+
3+
4+
/**
5+
* Created by Minarva on 12-10-16.
6+
*/
7+
import android.app.ExpandableListActivity;
8+
import android.content.Intent;
9+
import android.content.res.Resources;
10+
import android.graphics.Paint;
11+
import android.os.Bundle;
12+
import android.support.v7.app.AppCompatActivity;
13+
import android.text.TextPaint;
14+
import android.view.View;
15+
import android.widget.Button;
16+
import android.widget.TextView;
17+
18+
import com.zulip.android.R;
19+
import com.github.amlcurran.showcaseview.ShowcaseView;
20+
import com.github.amlcurran.showcaseview.targets.ViewTarget;
21+
22+
public class ChatBoxFeature extends AppCompatActivity {
23+
ShowcaseView showcaseView;
24+
TextView body;
25+
int flag;
26+
@Override
27+
protected void onCreate(Bundle savedInstanceState) {
28+
super.onCreate(savedInstanceState);
29+
setContentView(R.layout.chat_box_feature);
30+
final Button startButton = (Button)findViewById(R.id.button);
31+
final TextPaint titlePaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
32+
titlePaint.setTextSize(44.0f);
33+
34+
showcaseView = new ShowcaseView.Builder(this)
35+
.withNewStyleShowcase()
36+
.setTarget(new ViewTarget(R.id.chatbox, this))
37+
.setContentTitle("Swipe left or right to remove the chat box")
38+
.setStyle(R.style.CustomShowcaseTheme2)
39+
.build();
40+
flag = 0;
41+
body = (TextView)findViewById(R.id.switch_stream);
42+
startButton.setOnClickListener(new View.OnClickListener() {
43+
@Override
44+
public void onClick(View v) {
45+
if(flag == 0) {
46+
showcaseView = new ShowcaseView.Builder(ChatBoxFeature.this)
47+
.withNewStyleShowcase()
48+
.setTarget(new ViewTarget(R.id.switch_stream, ChatBoxFeature.this)).setContentTitlePaint(titlePaint)
49+
.setContentTitle("Press here to choose a stream")
50+
.setStyle(R.style.CustomShowcaseTheme2)
51+
.build();
52+
showcaseView.show();
53+
flag = 1;
54+
55+
}else{
56+
Intent i = new Intent(ChatBoxFeature.this, StreamPicker.class);
57+
startActivity(i);
58+
}
59+
60+
}
61+
});
62+
}
63+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package com.zulip.android.activities;
2+
3+
/**
4+
* Created by Minarva on 11-10-16.
5+
*/
6+
import android.app.ExpandableListActivity;
7+
import android.content.Intent;
8+
import android.content.res.Resources;
9+
import android.graphics.Paint;
10+
import android.os.Bundle;
11+
import android.support.v7.app.AppCompatActivity;
12+
import android.text.TextPaint;
13+
import android.view.View;
14+
import android.widget.Button;
15+
import android.widget.TextView;
16+
17+
import com.zulip.android.R;
18+
import com.github.amlcurran.showcaseview.ShowcaseView;
19+
import com.github.amlcurran.showcaseview.targets.ViewTarget;
20+
21+
public class MessageExplain extends AppCompatActivity {
22+
ShowcaseView showcaseView;
23+
TextView body;
24+
int flag;
25+
@Override
26+
protected void onCreate(Bundle savedInstanceState) {
27+
super.onCreate(savedInstanceState);
28+
setContentView(R.layout.message_explain);
29+
final Button startButton = (Button)findViewById(R.id.start_button);
30+
final TextPaint titlePaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
31+
titlePaint.setTextSize(44.0f);
32+
33+
showcaseView = new ShowcaseView.Builder(this)
34+
.withNewStyleShowcase()
35+
.setTarget(new ViewTarget(R.id.more_options, this))
36+
.setContentTitle("Long press on the Message to get more options")
37+
.setStyle(R.style.CustomShowcaseTheme2)
38+
.build();
39+
flag = 0;
40+
body = (TextView)findViewById(R.id.more_options);
41+
startButton.setOnClickListener(new View.OnClickListener() {
42+
@Override
43+
public void onClick(View v) {
44+
Intent i = new Intent(MessageExplain.this, ShowFeature.class);
45+
startActivity(i);
46+
47+
}
48+
});
49+
}
50+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package com.zulip.android.activities;
2+
3+
/**
4+
* Created by Minarva on 11-10-16.
5+
*/
6+
import android.app.ExpandableListActivity;
7+
import android.content.ActivityNotFoundException;
8+
import android.content.Intent;
9+
import android.content.res.Resources;
10+
import android.graphics.Paint;
11+
import android.net.Uri;
12+
import android.os.Bundle;
13+
import android.support.v7.app.AppCompatActivity;
14+
import android.text.TextPaint;
15+
import android.view.View;
16+
import android.widget.Button;
17+
import android.widget.TextView;
18+
19+
import com.zulip.android.R;
20+
import com.github.amlcurran.showcaseview.ShowcaseView;
21+
import com.github.amlcurran.showcaseview.targets.ViewTarget;
22+
23+
public class ShowFeature extends AppCompatActivity {
24+
ShowcaseView showcaseView;
25+
int flag;
26+
27+
@Override
28+
protected void onCreate(Bundle savedInstanceState) {
29+
super.onCreate(savedInstanceState);
30+
setContentView(R.layout.show_feature);
31+
showcaseView = new ShowcaseView.Builder(this)
32+
.withNewStyleShowcase()
33+
.setTarget(new ViewTarget(R.id.results, this))
34+
.setContentTitle("Swipe to the Left")
35+
.setContentText("Find users' online status and start private chat")
36+
.setStyle(R.style.CustomShowcaseTheme2)
37+
.build();
38+
39+
flag = 0;
40+
final Button startButton = (Button)findViewById(R.id.button);
41+
42+
startButton.setOnClickListener(new View.OnClickListener() {
43+
@Override
44+
public void onClick(View v) {
45+
{
46+
47+
Intent i = new Intent(ShowFeature.this, ChatBoxFeature.class);
48+
startActivity(i);
49+
}
50+
51+
}
52+
});
53+
}
54+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package com.zulip.android.activities;
2+
3+
/**
4+
* Created by Minarva on 11-10-16.
5+
*/
6+
import android.app.ExpandableListActivity;
7+
import android.content.ActivityNotFoundException;
8+
import android.content.Intent;
9+
import android.content.res.Resources;
10+
import android.graphics.Paint;
11+
import android.net.Uri;
12+
import android.os.Bundle;
13+
import android.support.v7.app.AppCompatActivity;
14+
import android.text.TextPaint;
15+
import android.view.View;
16+
import android.widget.Button;
17+
import android.widget.TextView;
18+
19+
import com.zulip.android.R;
20+
import com.github.amlcurran.showcaseview.ShowcaseView;
21+
import com.github.amlcurran.showcaseview.targets.ViewTarget;
22+
23+
public class StreamPicker extends AppCompatActivity {
24+
ShowcaseView showcaseView;
25+
26+
27+
@Override
28+
protected void onCreate(Bundle savedInstanceState) {
29+
super.onCreate(savedInstanceState);
30+
setContentView(R.layout.stream_picker);
31+
showcaseView = new ShowcaseView.Builder(this)
32+
.withNewStyleShowcase()
33+
.setTarget(new ViewTarget(R.id.results, this))
34+
.setContentText("Switch to a stream and start a chat")
35+
.setStyle(R.style.CustomShowcaseTheme2)
36+
.build();
37+
38+
39+
final Button startButton = (Button)findViewById(R.id.button);
40+
41+
startButton.setOnClickListener(new View.OnClickListener() {
42+
@Override
43+
public void onClick(View v) {
44+
{
45+
46+
Intent i = new Intent(StreamPicker.this, ZulipActivity.class);
47+
startActivity(i);
48+
}
49+
50+
}
51+
});
52+
}
53+
}

app/src/main/java/com/zulip/android/activities/ZulipActivity.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1387,6 +1387,9 @@ public void onClick(
13871387
case R.id.logout:
13881388
logout();
13891389
break;
1390+
case R.id.help:
1391+
openHelp();
1392+
break;
13901393
case R.id.legal:
13911394
openLegal();
13921395
break;
@@ -1436,7 +1439,10 @@ private void openLegal() {
14361439
startActivityForResult(i, 0);
14371440
}
14381441

1439-
public void onConfigurationChanged(Configuration newConfig) {
1442+
private void openHelp() {
1443+
Intent i = new Intent(this,MessageExplain.class);
1444+
startActivity(i);
1445+
} public void onConfigurationChanged(Configuration newConfig) {
14401446
super.onConfigurationChanged(newConfig);
14411447

14421448
// our display has changed, lets recalculate the spacer
115 KB
Loading
95.6 KB
Loading

0 commit comments

Comments
 (0)